The right hand one has had the number of colours reduced to 256, so there are 8 bits per pixel instead of 24, which means it is also stored in a third of the original size.Įven though it has lost just as many bits, the information removed has had much more impact on how it looks. The left hand image has been compressed to one third of the original size using JPEG while it is a "lossy" version of the original, the difference is unlikely to be perceptible. The middle image is the original, which was 24 bits per pixel. The following three images show the difference between reducing bit depth and using a specialised image compression system. However, image compression methods such as JPEG take advantage of patterns in the image to reduce the space needed to represent it, without impacting the image unnecessarily. In the data representation chapter we looked at how the size of an image file can be reduced by using fewer bits to describe the colour of each pixel.
There are other situations where images need to be stored exactly as they were in the original, such as for medical scans or very high quality photograph processing, and in these cases lossless methods are used, or the images aren't compressed at all (e.g.
This kind of compression is called lossy compression. This can lead to considerable savings in space, especially if the details that are missing are the kind that people have trouble perceiving. With a lot of images (especially photographs), there's no need to store the image exactly as it was originally, because it contains way more detail than anyone can see. Images can take up a lot of space, and most of the time that pictures are stored on a computer they are compressed to avoid wasting too much space.