Demonstration of Information Loss through Multistep JPEG Compression

The JPEG compression algorithm works by reducing the amount of information contained in an image. Compressing the same image multiple times leads to severe losses of quality, while the file size actually gets bigger! For this reason, storing an image in the JPEG compressed file format is not recommended for images that need to be processed further. Instead, one should always work with a lossless format, such as TIFF or PBM. Saving as .JPG should be the last step when an image is to be incorporated into a webpage or other presentation.

To demonstrate the effect of multiple compression steps, I took a normal chest radiograph from the Hammersmith Hospital PACS and converted it to PGM (Portable Graymap) format. The uncompressed filesize was 3264 kB, the pixel dimensions were 1755x1902 (width x height). I loaded this file into an image manipulation program (The Gimp), scaled it to one third of the original pixel resolution (585x634), and saved it as PNG (Portable Network Graphics, a lossless format). I then marked the file graphically with a "1", saved it as JPG with a quality setting of 50%, converted to PNG, reloaded the PNG, marked it with a "2", saved as JPG, converted to PNG, and so forth. The resulting images are shown below.

Note on browser compatibility: the PNG format used in this page doesn't seem to be supported very well by Netscape 4.75 and older versions. If the images look strange, please download them and view them with an image viewer or editor. Here's a zip file containing all images: jpgdemo.zip

Original PNG
The image shown as a (lossless) PNG.
File size: 148 kB

First compression
First compression step.
File size: 13679 Bytes

Third compression
Third compression step.
File size: 15725 Bytes

Eighth compression
Eighth compression step.
File size: 16169 Bytes

Original magnified
Detail of uncompressed image.

Demo 1 magnified
Detail of first compressed image.

Demo 8 magnified
Detail of eighth compressed image. Note how the rib contours suffer particularly badly.


Any comments? Please contact me. © 2001 Rolf Heckemann
Last modified: Fri Jan 5 11:33:55 GMT 2001