A method of compressing an image that enables 8 bits per pixel to look almost as good as 24 bits per pixel. The technique determines the 256 most frequently used colors in the image and creates a color lookup table, also called a "color map" or "color palette," that is stored with the image. Rather than each pixel in the image having all three RGB colors (one 8-bit red, one 8-bit green and one 8-bit blue), each pixel contains one 8-bit number that indexes into the 256-color lookup table, which contains the RGB values (see illustration below).
It Used to Be a Major Problem
When early computer screens were commonly limited to 256 colors, indexed color methods were essential. Even then, two indexed photos on screen at the same time with vastly different color schemes would overload the hardware's color capacity and cause images to display improperly. Today, computer hardware easily renders full 24-bit color, but 8-bit indexed images are still widely used to save bandwidth and storage space. See color depth
, color palette
and color lookup table
Color Palette Index
The pixels in the image contain index numbers that point to the RGB value in the color lookup table. The RGB values are the ones used by the display system.
24-Bit vs. 8-Bit
Indexed color images can look nearly identical to their 24-bit originals, because the 256 most frequently used colors are identified. The 256-color palette (top) was created in Photoshop from the original 24-bit image (left) to generate the image as 8 bits (right).