I have been looking for a way to arrange JPG images based on the quality/compression level of the images.

I want to do this so that I could select only those images which has less compression (let’s say 90-100%) and batch process them to lower compression level (say 75%) to save hard disk space.

I have loads of reference images with various compression level. If I apply compression to all the images then the ones with already low compression get reprocessed resulting really lower quality images.

Does anyone one know how could I select images based on the quality/compression?

I would really appreciate any help. Takias

| improve this question | | | | |
  • There appears to be a command line utility, now all you need is for someone to use it and make a gui based software to run batches of jpegs...photo.net/learn/jpeg/#jpegdmp – Moab Aug 25 '11 at 19:36

As far as I know, JPEG doesn't stores the "compression amount" inside it.

Thre is one extension to images, called EXIF, that can store some information about the picture, like the quality. Take a look at this site for some information.

| improve this answer | | | | |
  • 1
    This is correct - JPEG uses lossy compression, and doesn't store any value indicating how much it's been compressed. Any artifacts (quality degradation) introduced by image compression are completely relative to the viewer; the PC can't discern any differences. – Rob Aug 25 '11 at 19:57
  • 1
    It does not need to store the compression ratio. When you calculate height*width*3 you get the uncompressed size in bytes. Divide that by the size on disc and you have the compression ratio. – Jeff Aug 25 '11 at 20:09
  • @user79928: sorry, but the "compression ratio" in jpeg isn't a exact amount of space you gain by "compressing" it. Jpeg is a bit more complicated than that. Try yourself: pick a white image, .bmp, put three colored squares inside it. Then open it in a program that allows you to transform to JPEG and choose the quality factor. Use .99. You'll see that the size will reduce much more than 1% – woliveirajr Aug 25 '11 at 20:17
  • Compression rate and quality are different numbers. Your simple image will indeed get excellent compression at a high quality setting. A complex image may get bad compression even at low quality. Compression rate is easily (re)calculated, as I described. You are however correct that the quality setting used cannot be easily reproduced. – Jeff Aug 25 '11 at 21:19
  • @user : yes, you're right. But since the question was about re-compressing JPEG, I assumed he wanted to know about jpeg quality level, not exactly the compression size – woliveirajr Aug 26 '11 at 2:31

Close As I could find. Although it may not allow you to arrange them in any way.

JPEGsnoop reports a huge amount of information, including: quantization table matrix (chrominance and luminance), chroma subsampling, estimates JPEG Quality setting, JPEG resolution settings, Huffman tables, EXIF metadata, Makernotes, RGB histograms, etc. Most of the JPEG JFIF markers are reported. In addition, you can enable a full huffman VLC decode, which will help those who are learning about JPEG compression and those who are writing a JPEG decoder.

Other potential uses: determine quality setting used in Photoshop Save As or Save for Web settings, increasing your scanner quality, locating recoverable images / videos, decoding AVI files, examining .THM files, JPEG EXIF thumbnails, extract embedded images in Adobe PDF documents, etc.

| improve this answer | | | | |
  • Thanks you! Do you know if JPEGsnoop could be used for batch processing ? – Takias Aug 26 '11 at 4:46
  • Not sure, is assume it only analyzes one file at a time, but I could be wrong, give it a try. It was the only software I could find that even came close to what you need. – Moab Aug 26 '11 at 16:18

You should be able to do this by reading the exif information. If you're using windows then microsoft photo info allows exif information to be added to explorer, for newer versions I think it's built in. I'm not sure if this shows the compression as a column though so you may need to find some specialist exif reading software or use an image management tool.

| improve this answer | | | | |
  • I have lot of images that does not have any exif info embedded. Exif info is often absent in processed images. And that's the problem . – Takias Aug 26 '11 at 4:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.