Deliantra MORPG |
Last change: 2007-10-15
Have you ever asked yourself which of two given jpegs (same size) is the "original", i.e. which one was saved with higher quality? No? Then Go Away... Yes? Then Read On...
I often happened to ask myself wether this question can be answered at all. Sure, for general pictures, "higher quality" is a tough decision... a sharp picture (sharpened by a program for example) might have less quality (=originality !redundancy) than the fuzzy original. Judge only tries to answer which picture was saved in a higher quality, but this includes every save, i.e. I want to detect even the case when I picture was saved at low quality and later at high quality.
By a statistical analysis over the quantization table stored in a jpeg one could probably deduce the quality which the picture was saved (i.e. this particular save), but it does in no way say anything about the picture quality itself (i.e. wether it has ever been saved at lower quality before in it's life). For example, one might have saved a jpeg picture in low quality, and later saved in higher quality, yet the information lost during the first save can't be restored.
Judge makes an algorithmic analysis very similar to the jpeg compression algorithm, and then uses an heuristic to "guess" a quality factor between 0 and 1000.
Download the program source here:
X = Quality
Y = Judge's guess
As you can see, it is not the identity function. In the high quality region, this is easy to explain: the original pictures were jpeg's themselves, and these were definitely not saved with 100% quality.
The only picture with monotonic curve is "farbverlauf", a synthetic picture that was available in 100% quality.
Also, the behaviour of the curves is different in the x = [0..50[ range than in the x = [50..100] range. This is probably because the IJG JPEG library which was used to compress these pictures doesn't use a linear function to map "quality" (a value between 0 and 100%) into quantization factors.
Next I scaled the pictures to 10% .. 200% of their original size, while holding the quality constant at 70. A simple scaling algorithm without oversampling/subsampling was used. Again, perfect behaviour would result in a constant function.
X = Image size in percent
Y = Judge's guess
The result for the "farbverlauf" and "treppe" pictures is quite irregular. This can be explained by the aliasing effects with these pictures, which, at some sizes, really distort them.
To check this, I made the same test, only this time using a high-quality re-sampling algorithm (ImageMagick's -sample switch)
X = Image size in percent
Y = Judge's guess
Due to pgcc (mis?)optimization, ImageMagick refused to make small (<30%) images, so I only checked larger sizes.
As you can see, now the irregularity is gone, and while the curve still is not constant, but increasing with smaller sizes), it seems that judge does a relatively good job.
(GNUPlot 3.5 was used to plot these graphs.)
Any questions/hints/critics? Contact the author of this page!