GIF files are indexed color images that can contain a maximum of 8-bit color information (they can also be saved at lower bit rates). This means they can contain up to 256 colors -- the maximum number that 8 bits of information can define (28 = 256). Lower bit depths result in fewer colors and also reduce file size. This is discussed in Section 19.8, "Minimizing GIF File Sizes" at the end of this chapter.
"Indexed color" means that the set of colors in the image, its palette, is stored in a color table. Each pixel in the image contains a reference (or "index") to a table cell containing the color for that pixel. In Photoshop, you can view the table for an indexed color image by selecting Image Mode Color Table.
When you convert a 24-bit (millions of colors) image to GIF, it is necessary to first convert the image to Indexed Color mode, and as part of that process, reduce the number of colors to a palette of 256 or fewer colors. The image-editing tool does its best to approximate the full color range by using the most appropriate colors to approximate the image (an "adaptive" palette). You can specify an alternate set of colors to use in this process, such as the web palette. See the sidebar "Common Palettes" in Chapter 22, "Designing Graphics with the Web Palette" for descriptions of other color palette options.
Copyright © 2002 O'Reilly & Associates. All rights reserved.