Chuck Gardner's Photography Class
Part Three - Digital Photography Basics
by Chuck Gardner
Image Storage and Compression

As noted above, each RGB pixel in the image records 24 bits of data, which requires the same amount of storage space needed for three characters in this document (i.e., 3 "bytes"). Thus, when you take a picture with a 1.6 megapixel camera, it must process and store 1600 x 1000 x 3 = 4,800,000 bytes (4.8 MB) of data. A camera with 3.45 megapixel resolution will generate and must process 2500 x 1500 x 3 = 11,250, 000 bytes (11.25 MB) of data for each image!

With some cameras it is possible to record all of the image data using TIFF or other "lossless"file formats which retain every bit recorded. Digital digital cameras also use a file compression algorithm known as JPEG to reduce the file size. JPEG data compression is similar to how a cashier in a supermarket with a price scanner operates. If you buy a case of soft drinks the cashier scan one can to get its value then enter the quantity "24" to record the fact there are 24 cans with that value. The JPEG software scans the image row-by-row looking for areas were numerous pixels have the same or similar tone, and records 100 similar pixels with the color of the first, plus a notation to make the next 99 the same when the file is displayed. The net effect is a significant reduction or compression in file size without a significant loss of actual image data.

Because the value of each color is stored as a finite value consisting of 256 levels each of Red, Green, and Blue (256 x 256 x 256 = 16,777,216 discrete colors) it is possible for the JPEG algorithm to further compress the image by encoding pixels within a similar range of color as if they were the same color. In other words, if ten adjacent pixels in the sky of a photograph differed by only slightly the JPEG algorithm will average them and encode them as that color x 10, reducing the data storage required by a factor of almost 10 to 1 (i.e., 10:1). The downside of this type of JPEG compression is that subtle details which were recorded by the CCD array are irrevocably lost.

Compression in the camera

Because digital cameras typically offer several different "quality" levels for image capture using generic terms such as "uncomp", "best", "better", and "good" it is impossible to explain here what they represent. In some cameras such as the Kodak DC290 I use, "uncomp" quality stores the file in uncompressed TIFF format using 6.6 MB to record each 1792 x 1200 pixel image (1792 x 1200 x 3 = 6,451,200) while "best", "better", and "good" apply progressively more JPEG compression and smaller files, but at the expense of lost image detail.

Goto Next Page >

Goto < Previous Page

Goto Class Outline

Goto super.nova.org my home page.