JPEG Compression

(Application of Discrete Fourier Cosine Transforms)

JPEG Compression Routine

The following is a short summary of what happens when using the JPEG image format.
  1. JPEG Compression breakes an image into a series of square patches of pixels.
  2. A two dimensional Discrete Fourier Cosine Transform is applied to each patch.
  3. Transform coefficients that are very small in magnitude will have very little affect on the image and are, therefore, set to zero.
  4. The coefficients are then reduced in size by applying a compression algorithm.
  5. When restoring the image, the image file is decompressed and each patch is sent through an inverse Discrete Fourier Cosine Transform.
The image is now in a displayable form.  Notice that this is not a lossless compression format like GIF.  It throws away the least significant image data.

JPEG Compression Examples

The following illustrates the compression capabilities of JPEG and its associated image compromises.

Comparison Image - GIF

The comparison standard is a 720X360 image saved in GIF format.  If this file were saved in a raw format with no compression it would take259kB to store this data.  With the GIF compression the file occupies 153kB, which is a compression of 40% in size.  GIF is a loss less compression format that allows up toe 256 different colors.

Standard JPEG

The image given above was converted to JPEG using Paint Shop Pro v6.0.  The default compression value is 15 which gives good compression without sacrificing image quality.  The JPEG compression format allows the image to have 16Million colors.  The size of the compressed image file is 46kB.  This results in a size compression of 82%.  (This is 5 times smaller than the original raw data.)  Only the discerning eye will be able to notice a difference between the two images.

JPEG with More Compression

This image is in JPEG format where the compression value is changed to 45.  This file now occupies 23kB on the computer.  This is a 91% reduction in size.  (The file is 10 times smaller than the original data file.)  Notice the image is a little blurrier.

JPEG with Higher Compression

This image is in JPEG format where the compression value is changed to 85.  The file is 11kB in size, which is a 95.8% reduction in size.  (This file is 23.5 times smaller than the original data.)  The blockiness that appears is due to the discontinuities between patches where the cosine transform is applied.

JPEG with Extreme Compression

This image is in JPEG format where the compression value is changed to 99.  The file is reduced by 97.7% to a size of 6kB.  This file is 43 times smaller than the original data.  This image clearly shows the blockiness resulting from throwing out the smaller cosine transform coefficients.