Indexed colors
Also called: indexed color
A graphic file with indexed colors is an image whose color palette is limited to colors defined in an index. Working with a limited color index keeps the file size down, saving storage space, working memory and data traffic.
In most file formats that work with a predefined color palette, the colors are stored pixel by pixel. For each pixel of an image, it is defined what color it should be based on a number that refers to the color index included in the file. Compression techniques can then be applied to the series of numbers this results in to minimize the size of the resulting file in bytes.
Examples of file types with indexed colors are GIF and PNG. The palettes of these file formats can include transparency in addition to the colors used in the file.
Compression with loss of quality
A file with indexed colors is smaller in size because smaller numbers can be used within the file. For an image consisting of 256 colors, only 8 bits are needed for each pixel. Partly because some detail is usually lost during conversion, images can be stored efficiently.
Working with indexed colors generally does result in loss of quality. The fewer colors a file contains, the smaller the file size, but the greater the loss of quality.
This becomes especially apparent when using photographs and other highly detailed images with indexed colors. Typically, this results in images with large areas of "average" color. Although this phenomenon can often be masked somewhat by applying noise (dither) and smartly choosing the colors within the palette using algorithms.