1

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.

Fake Name
  • 3,340
  • 20
  • 22

3 Answers3

2

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.

Fake Name
  • 3,340
  • 20
  • 22
-1

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.

MirekE
  • 5,205
  • 11
  • 10
  • 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 04: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 05: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 05:01
  • The IM documentation I linked above mentions jpegqran/jpegtrans (http://www.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 05:18
-2

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.

MarcinWolny
  • 1,400
  • 1
  • 14
  • 35
  • 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
  • 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
  • Basically, I'm seeking to be able to determine, with decent accuracy (99%+), if/which image out of two is closer to the original, in an automated manner. – Fake Name Dec 11 '14 at 10:28
  • Philip Kendall - all of these are parts of standard JPG specification. # Fake Name - you can perform statistical analysis on difference between original and modified image just fine. – MarcinWolny Dec 11 '14 at 10:28
  • 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
  • Basically, I need a decent corpus of images compressed with different tunable parameters to do any sort of analysis. – Fake Name Dec 11 '14 at 10:32
  • Yea, yea, I get it just fine, thank you, no reason to write 20 messages on the same thing. If you have a basic problem with performing analysis of difference between two images - ask on stackoverflow, perhaps there someone can guide you through the basics of programming. Here we answer questions related to photography, not statistical analysis of images. I answered you stuff related to the topic of this stackexchange. Otherwise - you're asking in a wrong place. – MarcinWolny Dec 11 '14 at 10:33
  • 1
    Everybody: keep it polite. – Philip Kendall Dec 11 '14 at 10:35
  • I would argue that understanding image compression is a core part of modern photography. If there is a stack exchange better suited to the question, I'm open to moving the question. – Fake Name Dec 11 '14 at 23:43
  • Feel free to argue, but not with me, even though I disagree. But as said - discussions about implementing statistical analysis of images is something that belongs more to stackoverflow than anything directly related to photography. – MarcinWolny Dec 12 '14 at 12:12
  • @MarcinWolny - I asked on StackOverflow and got closed. So not, it apparently does not. Anyways, I know how to do the analysis, that parts easy. It's getting an idea of what's out there that is hard. – Fake Name Dec 15 '14 at 03:59