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.
In a previous posting, Gerry Foley [email@example.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:
open the previous generation
make a change to the image (I added text to indicate the generation
save a copy as a JPEG with a new generation number
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.
Paste a later generation into a PhotoShop file on a layer above an
Invert the layer that is of the later generalization.
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.
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
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.