JMG Galleries
Photography by Jim M. Goldstein
 
 
 
JPEG Compression: Data Loss & Image Impact
Guest Article by Oskar Breuning | Additional Comments By Jim Goldstein
 
Jim M. Goldstein
JPEG Compression Test
JPEG Compression Text Examples and Conclusions
click to enlarge
A friend of mine, Oskar Breuning, recently enlightened me regarding an aspect of working with JPEG format files that may drastically impact image quality. At the core of Oskar's observation is that when working with a JPEG file, in many programs (potentially even Photoshop which we're verifying), each alteration made will prompt a save in the program before you manually pursue a final save of your changes. The end result is not just one round of data loss due to JPEG compression when you save your final version of an image, but several rounds of data loss reflecting the number revisions made before your final image is saved. I've always known about the theoretical impact of JPEG compression on images, but have never seen a definitive test showing the extent compression can ruin an image until now thanks to Oskar. For those not sold on working with a lossless format such as Photoshop (PSD) upon seeing the results posted below you will likely become a believer.


Oskar Breuning
I know a lot of photographers now use dSLRs saving photos in RAW format. (I do, too). For those photographers capturing images in JPEG format only and others that edit JPEG images outside of the world of photography here's something useful to know:

Since JPG compression is lossy compression, with every save you lose data. The loss is set up in a way that it tries to remove data the eye cannot quite see (two pixel with almost same color and brightness). So every time you open a JPG, do something with it and save it as JPG again you lose data. That also means when you press the "rotate" button in windows, you already lose data (the image is opened, rotated and saved again).

I became curious and wanted to see what happens as numerous alterations are made. I set up ImageMagick's command line "convert" program on my home Linux box to do several rotations, and re-saving. Attached is the result with (4) four different images and different numbers of rotations.

What was interesting to me was, that I expected to see the typical 8x8 JPG blocks or something along that line to appear, but instead the main change in the image was the desaturation of color .
Note: Images were always saved with highest JPG quality. Lower quality will probably cause more severe image degradation.

To prevent this, if you do shoot JPEG, you will want to save your image on your camera or computer as TIFF or Photoshop (PSD) and then work with that format. You can save this as often as you like without losing anything. Then, you save a copy as the final version as JPG again, which you can email to your friends and family. In this way you lose a minimal amount of data once that is not visible. It's the saving again and again that is a problem. Otherwise JPEG is great is a great file format.

JPEG Compression TEST - Image Gallery
JPEG Compression - Sequence of Alteration Results
click to enlarge
JPEG Compression - Sequence of Alteration Results
Compression - Before & After Comparison
click to enlarge
JPEG Compression - Before & After Comparison
Your Donations Make Articles Like This Possible: