Each time a JPEG is modified and saved, the image gets a little worse. After some discussion on a digicam list server, I decided to look into this.

Method

In a previous posting, Gerry Foley [gfoley@columbus.rr.com] had published an image that apparently did not degrade at all after being resaved sixteen times. Subsequently he published other images that did degrade. Probably, the original images did not degrade because PhotoShop 5.0 detected that an image was being saved that had not been altered, and did not recompress the image.

Using PhotoShop 5.0.2, I took the same image that he had used and saved 8 generations through the process:

  1. open the previous generation

  2. make a change to the image (I added text to indicate the generation number)

  3. save a copy as a JPEG with a new generation number

  4. close the file.

I followed this procedure twice, once saving at the PhotoShop JPEG quality level 9 (relatively less compression), and then again at quality level 5 (which is more compressed). The generation-1, level-9 file was 15,684 bytes, whereas the generation-1, level-5 file was 10,404 bytes.

Upon reloading the saved image it was difficult to see any distortion. The following technique was used to make the distortion more evident.

  1. Paste a later generation into a PhotoShop file on a layer above an earlier generation.

  2. Invert the layer that is of the later generalization.

  3. Set to opacity at 50%. (If you do this to two identical images, you get a uniform 50% gray because, half the color value of each channel in each pixel is of the upper layer is subtracted from half of the corresponding color value in the lower image.) In this case there was a color bias (which I can't explain) and the only easily visible differences were from the text that I added to identify the generation.

  4. In order to amplify the differences, I did a copy merged and then pasted the clipboard into another layer. I then reset the light levels for that layer to the values (103, 1.0, 143) using the Image Adjust Light Levels command.

For each quality level, I compared:

Generation 4 - Generation 0

Generation 8 - Generation 0

Generation 8 - Generation 4

Conclusions

The results are shown below. After 8 generations of saving and re-editing an image there was observable differences in the images. At compression level 9, artifacts were easy to see in the 8th generation. At compression level 5 the artifacts were visible in the fourth generation..

Generally, most of the damage is done the first time the image is saved. Subsequent saves show relatively less degradation.

A single PhotoShop file with all the layers described here may be downloaded by clicking here.

Image Comparison
Generation 0
gen0.jpg (17319 bytes)
 
Generation 4, Quality Level 9
gen4.jpg (15781 bytes)
Compared to Generation 0
gen4comp9-gen0.jpg (21985 bytes)
Generation 8, Quality Level 9
gen8.jpg (15816 bytes)
Compared to Generation 0
gen8comp9-gen0.jpg (22339 bytes)
Compared to Generation 4
gen8comp9-gen4comp9.jpg (18929 bytes)
Generation 4, Quality Level 5
gen4comp5.jpg (10415 bytes)
Compared to Generation 0
gen4comp9-gen0.jpg (21985 bytes)
Generation 8, Quality Level 5
gen8comp5.jpg (10418 bytes)
Compared to Generation 0
gen8comp5-gen0.jpg (26906 bytes)

Compared to Generation 4
gen8comp9-gen4comp9.jpg (18929 bytes)