JPEG Compression: The real story

(Last Updated: January 22, 2002)


Any self-respecting graphic designer will tell you that JPEG images are always inferior to uncompressed TIFF files. Saving an image as a JPEG file effectively "throws away" image data in order to create a small file. Clearly, people interested in producing high quality photographs can't afford to throw away image data, say the graphic designers, and JPEG files should be avoided like the plague. In reality, the story isn't quite so simple...

JPEG compression is truly amazing for a number of reasons, not least is its ability to "throw away" a lot of image data without any significant impact on the apearance of the image. Exactly how it does this is beyond the scope of this article (although if you are technically inclined there is some really interesting reading here), but this simple demonstration should prove the point that when applied conservatively, JPEG compression is essentially invisible to the human eye.

uncompressed PNG file
110KB PNG image (226KB TIFF image)
Moderately compressed JPEG file
34KB JPEG Compressed image
difference between compressed and uncompressed file
Difference between JPEG and TIFF

On the left is a PNG file. The equivalent TIFF file (which I would have put on this page if all browsers...cough, Internet Explorer, cough...were able to display it) is visually identical and twice as big: 226KB. On the right, is the same image saved as a JPEG file. The file is only 15% of the size of the TIFF image. Clearly, it has been significantly compressed, but does it look any worse? Not to my eyes.

But there is a more scientific way of detecting the damage done to the image by JPEG compression...the third image shows the "difference" between the TIFF and JPEG images. It was created in an image editing program by layering one image on top of the other and then setting the blending mode to difference. Any pixels that are not identical in the JPEG and TIFF images should show up as bright, colored dots. The more dots, and the brighter they are, the bigger the difference between the JPEG and TIFF files.

So if JPEG compression is so destructive, where are all the differences? Well, there probably are some differences, but they aren't visible with normal human eyesight. The third image is not completely black -- some of those pixels are marginally "off-black". But, it should be clear that for all intents and purposes the JPEG and TIFF images are essentially identical. So why is JPEG a persona non grata in "professional" imaging circles? I don't know but I suspect that it is a combination of things:

  1. People learn the "TIFF=good, JPEG=bad" mantra early, and never question their assumptions.
  2. Too much JPEG compression (i.e.high compression settings) can be a bad thing. At some point the image degradation does become visible, and it isn't pretty.
  3. Repeatedly saving and resaving a JPEG file can cause the image degradation to accumulate. Too much of a good thing can be a problem...use a lossless format such as TIFF to save working copies of files before saving a final version.

Questions or Comments? Send them to Max Lyons


Home