catcode.com > Guide to Images > Lossy Compression

Lossy Compression

Since the JPEG formulas are a “best fit” to the pixels that it starts with, rather than an exact fit, the pixels you started with won't be the same ones you end up with when you view the picture. Some of the color information will have been lost. This is called lossy compression.

So, with JPEG compression, what you saved is not what you will see:

Original Drawing:
Grid showing gradual darkening from top left to bottom right
File save generates factors:

1.3, 2.45, 6.87
You view file in browser.
These factors:

1.3, 2.45, 6.87

are plugged into formula, generating...
What you see:
Grid showing different darkening from top left to bottom right

By the way: the GIF method is lossless; it reproduces exactly the pixels that were in the original image upon viewing.

You can set the accuracy with which the formula approximates the original pixels when you save a file. The more compression, the smaller the file, but the less the accuracy. Here's an example of a picture saved at three different quality levels. The program we used lets you set the quality from 100 (best) to zero (worst).

picture of dragon with balloons
Quality level: 90
File size: 10,582 bytes
picture of dragon with balloons
Quality level: 50
File size: 5,154 bytes
picture of dragon with balloons
Quality level: 1
File size: 923 bytes

The moral of the story: you may wish to save your JPG files at various levels of compression; if a smaller file looks acceptable, use it.

<< JPG
^ Index