Book 'Ball'Managing Multimedia    
   
     
 

Effects of JPEG Compression

WARNING: This page will only make sense if viewed with a 16 or 24 bit display.

 This is a highest quality JPEG image of the Matterhorn. Although there are artefacts from the compression they are very difficult to see.

The artefacts are more visible here after 'low quality' JPEG compression. JPEG works by analysing the patterns in regular blocks of the image and removing the 'less important' information. The main sign of compression is blocking and the blocks are most visible in areas of nearly flat colour and around the edges of things in the image where the colour changes significantly.

In this picture you should be able to make out the rectangular 'clouds' in the sky to the left of the mountain. Artefacts can also be seen in areas of fine detail and on edges. Look at the boundary between the white of the mountain and the blue of the sky and you will also see effects of JPEG compression.

JPEG is a very good compression system so even at a low quality setting (as here) you may not see any artefacts, or may think they are actually a natural part of the picture. Indeed the real test is whether you can see any artefacts at all, and different images will give different results. JPEG is optimised for real images and in a real photographic image there are none of the very sharp edges and changes in brightness and colour that can be produced with a computer-generated image. A typical compression ratio for JPEG is ten or twenty to one, which makes it a far better choice than an eight bit adaptive palette image which will achieve a basic compression of only three to one.

We can make the blocking in the Matterhorn photograph even more visible by directly comparing the 'before' and 'after' images; and this is what has been done below.

 This is a black and white image which shows the difference between the last image and the uncompressed original, with its brightness range stretched so it shows the information removed by JPEG compression. The blocks are clearly visible to the left of the mountain and will show you where to find them in the colour image above. Because JPEG removes information from the image, and the exact original can not be rebuilt, it is said to be lossy or destructive.

So why would you use compressed images with less-than-perfect quality rather than use the uncompressed originals? The two reasons are data space and the time it takes to load the image from a disc or a network. Smaller files will help in both these cases.

Of course, reducing the resolution of an image by simply making it smaller, or reducing the number of colours in an image, which is outlined in the comparison of different colour bit depths, are also forms of compression.

   
mini ballBook 2 Chapter 8 - Graphics Asset Production