The JPEG File Format for Your Digital Images - dummies

By David D. Busch

Virtually every dSLR currently on the market can create JPEG (Joint Photographic Experts Group) files. About 20 years ago, a consortium of the same name created this format. (The consortium originally consisted mostly of vendors such as Eastman Kodak Company, but an international standards body now oversees it.)

The goal of devising the JPEG format was to create files that are significantly smaller than you can produce by using formats such as TIFF, which compresses files somewhat without discarding image information, and to make those files readable by a wide variety of applications in a standard way.

The first JPEG-capable applications reduced the time needed to transmit images by telecommunications links. The Internet wasn’t in wide use by the public at that time. So, newspaper photographers had to plug their unwieldy portable computers (laptops of that era needed several laps to support them) into devices called modems to beam their photographs back to the editorial office over telephone lines.

JPEG can reduce files by a factor of 20 or more by throwing away some of your hard-won image data in a series of processes that are intended to reduce the size of the file by eliminating excess or redundant information.

JPEG compression first divides your image into luminance (brightness) values and chrominance (color) information, on the theory that human eyes are less fussy about color than they are about brightness. (If you see a stop sign that’s a slightly odd shade of red, you notice that color less than if the same sign were to appear darker or lighter than you expect.) The redundant color information is discarded.

The process slices your image into cells, say 8 x 8 pixels on a side, and then the process looks at each of the 64 pixels in the resulting chunk individually. Using mathematical trickery called Discrete Cosine Transformation (DCT), the compression process discards pixels that have the same value as the pixels around them. (You don’t have to remember terms such as Discrete Cosine Transformation unless you’re trying to impress someone at a party.)

Next, quantization occurs, during which pixels that are nearly the same color are converted to a common hue, and the picture information that’s left is transformed into a series of numbers, which is more compact than the original information. (It’s a bit like writing 1,500 rather than one thousand five hundred.)

If everything is done properly, the process compresses the image by 5 to 20 times or more, depending on what compression level you select when you save the file.

Because JPEG doesn’t keep all the image information, it’s referred to as a lossy format. Each time you load a JPEG image, make changes, and then save it again, you run the danger of losing a noticeable amount of information because the JPEG process occurs all over again — every time you save.

The loss might be very slight at first, but it can accumulate. The figure shows a photograph that has lost sharpness after repeated savings in JPEG format.


What’s cool about JPEG is that you can dial in the amount of compression you want, using a lot of compression to produce very small file sizes (with an attendant loss in quality), or very little compression to preserve quality at the cost of larger files. What isn’t cool is that no one has come up with a standard way of referring to the amount of compression.

Digital cameras tend to use discrete steps with names such as Superfine, Fine, Normal, Good, and Basic. Image editors might let you choose a continuous compression/quality range from, say, 0 to 15 or 0 to 20. (The Nigel Tufnel in you might wish that your editors offered an all-the-way-to-21 setting for when you need just that little bit of extra quality, but unfortunately, the designers of these applications apparently have never seen the movie This Is Spinal Tap.)

Instead, in-camera JPEG compression is a little like a box of chocolates: You never know what you’re going to get.