Link to home
Start Free TrialLog in
Avatar of ginsonic
ginsonicFlag for Romania

asked on

JPEG compressor algorithm


How can I get JPEG compression for maximum quality in a minimum file size?

Alike Adobe Photoshop compression or Advanced JPEG Compressor ?
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of VGR
VGR

yes.
Usually JPGs are compressed at 80%
You may change this using the suggestion above and the classical StretchDraw aftet Bitmap.Assign (see "how to make a thumbnail" somewhere)

For the REAL algorithm itself, It should be findable using google (Huffman? Alike LZW? )
You could compute a difference map (e.g. subtract each pixel of the original image from the newly packed an unpacked temporary JPEG). Then compute the average difference of all pixels alltogether and choose a value that you consider to be acceptable for "good quality" using this difference.
Now do this with a binary search approach so long until you get to the optimal value for that particular image.

This can be used as method to find the optimal % value for a particular image to be compressed to JPG.
Avatar of ginsonic

ASKER

Sorry for delay :)