I'm looking to do some statistical analysis on the effect on an image of various compression systems, with the end-goal of hopefully being able to determine which is a recompressed version of which. To do this, I need to be able to feed a set of test-images through a assortment of different image compressors.

Are there any resources for this sort of thing? Is there anything like a website where I can submit something, and get versions recompressed via an assortment of compressors?

Alternatively, is there any good information on which compressors are commonly used? I'm realizing I don't even know to what extent most of the image editors out there share code.

  • 2
    As PNG is lossless, what are you aiming to do there? – Philip Kendall Dec 10 '14 at 9:22
  • @PhilipKendall - Good point. I could have sworn it had a lossy option, Whoops? – Fake Name Dec 10 '14 at 9:36
  • PNG doesn't have a lossy option but IIRC you can adjust how aggressive the compression algorithm is on some implementations. – James Snell Dec 10 '14 at 16:52
  • @PhilipKendall - Good point, moved. – Fake Name Dec 18 '14 at 1:11

I'm basically going to answer my own question: No.

There are no decent facilities for comparing JPEG compression libraries.

Additionally, I did some further experimentation which effectively invalidated the hypothesis that produced my desire for a comparative analysis in the first place, so the whole question is somewhat moot at this point.

I did a bunch of testing with the compressor used in PIL (which is libjpeg):
enter image description here

This is over the corpus of the USC-SIPI image test set, looking at the average entropy per pixel as a function of various compression ratios.

I did a writeup here.


I am not sure if you are looking at different compression options strictly for JPEG or if you are interested in other formats with lossy compression.

But in any case, I think Imagemagick would be a good starting point. It is a command line based tool and there is also PythonMagick that I never used, but which allows using IM directly from Python scripts.

Here is some reading about JPEG options in IM: http://www.imagemagick.org/Usage/formats/

And here is a list of supported file formats, in case you consider supporting other formats like Jpeg2000 etc.: https://subversion.imagemagick.org/subversion/ImageMagick/branches/ImageMagick-6.5.5/www/formats.html

I think it would be a good idea to also test webp image format introduced by Google that some believes is superior to jpeg

Edit: Reading through the resources I linked above I found JPEG online laboratory that might be useful for your work.

  • I was interested in exclusively the differences between different JPEG systems. As I said, my end goal is to be able to automate the determination of whether one image is a recompressed version of another. My image corpus is probably 90% JPEG, 10% PNG, and basically nothing else. No one really uses webp images or anything like that. – Fake Name Dec 17 '14 at 4:57
  • Also, again, I don't need information on the analysis part (I understand that fairly well). I'm /only/ looking for information regarding what varies between different JPEG libraries. – Fake Name Dec 17 '14 at 5:00
  • Anyways, apparently ImageMagick uses libjpeg, which is also used by PIL, so I've basically already got that covered anyways. – Fake Name Dec 17 '14 at 5:01
  • The IM documentation I linked above mentions jpegqran/jpegtrans (jpegclub.org) that use different compression. I believe IM can be recompiled with jpeg-turbo (which is faster, but I don't know if the codec is the same or not). – MirekE Dec 17 '14 at 5:18

Use difference blending in photoshop - original image in a bottom layer, changed image in a top layer. Everything that's not black will be changed from the original image.

Also: If I remember well there's no such thing as "different compressors" - JPEG is one strictly described compression algorithm. To simplify: implementations differ only in how value X on your compression scroll bar translates to the compression strength in the actual algorithm, but the algorithm is always the same.

  • 2
    "JPEG is one strictly described compression algorithm". So why does the GIMP give me "Optimize", "Smoothing", "Subsampling" and "DCT method"? – Philip Kendall Dec 11 '14 at 10:21
  • 2
    Sigh. 1. There are very, VERY much different (Look at the section labeled "Rainbowing") approaches and different choices with regard to constants and such in the design of the compression system. The JPEG standard may be well-defined, but there are LOTS of tuneable parameters for the actual compression that are all well within the standard, and vary from software to software. – Fake Name Dec 11 '14 at 10:23
  • 1
    2. I'm doing statistical analyses. I'm not using photoshop, I'm using a script I wrote that directly quantifies the entropy-per-pixel. Just "looking" at something has basically zero scientific rigor. – Fake Name Dec 11 '14 at 10:25
  • 2
    You're missing the point, there are a lot of tuneable options in the JPG specification and they vary between different implementations. Some applications expose some of them (GIMP), some have hard-coded values (Photoshop). Claiming the only thing that can vary is the compression degree is flat-out wrong. – Fake Name Dec 11 '14 at 10:30
  • 1
    Everybody: keep it polite. – Philip Kendall Dec 11 '14 at 10:35

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.