[Written for Better Digital Photography magazine, 2004]

 

Compression explained

It’s the secret of how your camera stores images on a memory card, so what is file compression?

If you’ve had a digital camera for more than a couple of days, you’ve probably come across the acronym JPEG by now, and you may be wondering exactly what it means. The letters themselves stand for the Joint Photographic Expert Group, a body of scientists, programmers and engineers from the camera industry who got together several years ago to come up with a new standard for file storage that would allow images from different computer programs to be interchangeable, so that a picture from one machine could be viewed on another without having to go through tedious file conversion programs.

The JPEG standard also happened to be an ideal format for storing pictures on a digital camera, because it uses something called file compression. This is a technique that allows a large number of images to be stored in a relatively small amount of memory by squashing the files so they take up less room. For this reason JPEG has become the standard image file format for all digital cameras.

 

By the book

File compression is a very complicated subject, and a full technical explanation of it would fill a decent-sized textbook. It uses complex mathematical formulae that you simply don’t need to know unless you’re a software engineer working on a new digital camera. As consumers, all we need to know is that it reduces the size of the picture file by reducing the amount of information stored in it. Compression reduces file size by reducing picture quality, and for this reason it is called “lossy” storage. There are other types of image file which are uncompressed and lose no quality, the main one being the TIFF format, but we’ll talk about that another time.

 

You lose some…

Basically, the way JPEG compression works is like this. An average digital photograph contains varying levels of detail. For example, take an average holiday snap, of a family on a beach. While the main subject, the people in the foreground, contains a lot of detail, there will also be large areas such as the sky, the sand and the sea, which contain relatively little detail. In order to reduce the size of the file, some data from the lower detail areas can safely be lost without affecting the quality of the picture too much. The way this is done is usually by reducing the number of tonal variations between areas of similar colour, so you may notice artefacts that look like squares or stripes in highly compressed images.

 

…you win some

Whatever make or model of digital camera you have, it will almost certainly have an option in the menu that allows you to select image quality. What this option is doing is setting the level of file compression. If you select the lowest quality, you will probably find that you can fit about four times as many images onto your memory card as you can at the highest setting, because the higher JPEG compression setting makes the files on quarter as big, but reduces the quality of the picture to compensate. Most people will use the highest setting most of the time, but unless you intend to print all your pictures at the largest size possible, you really can get away with using a lower quality setting and still have pictures to be proud of, plus you’ll be able to take twice as many.