JPEG



JPEG stands for Joint Photographic Expert Group, the creators of the standard.

JPEG was designed to compress photographic quality images in either gray scale or full color and does not work well with line drawings or black and white images.

JPEG exploits the limitations of human vision:

JPEG allows parameters to be set that decide on the degree of compression.

The greater the compression, the lower the quality, and the more noticeable the flaws are.

Compressions of 10:1 or 20:1 are often used, however. Even 100:1 compression is possible, but with low quality results.

The JPEG compression algorithm generally begins with a 24-bit stored image, and can often lower the requirement to 1-2 bits per pixel!

JPEG tries to remove redundant information. For example, if half of a picture consists of blue sky, the beginning and end of this single color can be stored so that the entire range can be recreated when the picture is shown. Although some content may be lost at higher compressions, our eyes fill in the gaps until the compression gets too great.

There are two components to how the human eye views color - one is the intensity of the color, and the other is how much the intensity varies along the picture:

The JPEG algorithm operates in three steps:

    Step 1: Discrete Cosine Transformation (DCT)

    Step 2: Coefficient Quantization

    Step 3: Entropy Encoding

Steps 1 and 3 are lossless. (There is a lossless version of JPEG whose Step 2 uses a method involving a predictive/adaptive function which predicts upcoming pixels based on previous pixels (think of the blue sky)).

To reconstruct the picture, the compressed version is decoded and shown on the screen. It reconstructs the quantized data and then recreates the 8x8 blocks again.

JPEG can reduce the storage size to 1/100 of the original, but often 1/20 JPEG compression is used because more than that causes a degradation of the picture to our eyes.

It does well on natural pictures that don't have sharp edges.

Nice diagram of JPEG compression algorithm