In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer storage, while speeding up display refresh and file transfers. It is a form of vector quantization compression. When an image is encoded in this way, color information is not directly carried by the image pixel data, but is stored in a separate piece of data called a color lookup table (CLUT) or palette: an array of color specifications. Every element in the array represents a color, indexed by its position within the array. For color information, each image pixel then specifies only its index into the palette. This technique is sometimes referred as pseudocolor or indirect color, as colors are addressed indirectly.
History Early graphics display systems that used 8-bit indexed color with frame buffers and CLUTs include Shoup's SuperPaint (1973) and the video frame buffer described in 1975 by Kajiya, Sutherland, and Cheadle. These supported a palette of 256 RGB colors. SuperPaint used a shift-register frame buffer, while the Kajiya et al. system used a random-access frame buffer. A few earlier systems used 3-bit color, but typically treated the bits as independent red, green, and blue on/off bits rather than jointly as an index into a CLUT.
Palette size
The palette itself stores a limited number of distinct colors; 4, 16 or 256 are the most common cases. These limits are often imposed by the target architecture's display adapter hardware, so it is not a coincidence that those numbers are exact powers of two: 22 = 4, 24 = 16 and 28 = 256. While 256 values can fit into a single 8-bit byte (and then a single indexed color pixel also occupies a single byte), multiple pixel indices with 16 (4-bit, a nibble) or fewer colors can be packed together into a single byte (two nibbles per byte, if 16 colors are employed, or four 2-bit pixels per byte if using 4 colors). Sometimes, 1-bit (2-color) values can be used, and then up to eight pixels can be packed into a single byte; such images are considered binary images (sometimes referred as a bitmap or bilevel image) and not an indexed color image. If simple video overlay is intended through a transparent color, one palette entry is specifically reserved for this purpose, and it is discounted as an available color. Some machines, such as the MSX series, had the transparent color reserved by hardware. Indexed color images with palette sizes beyond 256 entries are rare. The practical limit is around 12 bits per pixel, 4,096 different indices. Useful direct RGB high color modes can be used from 15 bpp and up. If an image has many subtle color shades, it is necessary to select a limited repertoire of colors to approximate the image using color quantization. Such a palette is frequently insufficient to represent the image accurately; difficult-to-reproduce features such as gradients will appear blocky or as strips (color banding). In those cases, it is usual to employ dithering, which mixes different-colored pixels in patterns, exploiting the tendency of human vision to blur nearby pixels together, giving a result visually closer to the original one. Here is a typical indexed 256-color image and its own palette (shown as a rectangle of swatches):
Colors and palettes
How the colors are encoded within the color palette map of a given indexed color image depends on the target platform.
Early color techniques Many early personal and home computers had very limited hardware palettes that could produce a very small set of colors. In these cases, each pixel's value is mapped directly onto one of these colors. Well-known examples include the Apple II, Commodore 64 and IBM PC CGA, all of which include hardware that can produce a fixed set of 16 colors. In these cases, an image can encode each pixel with 4 bits, directly selecting the color to use. In most cases, however, the display hardware supports additional modes where only a subset of those colors can be used in a single image, a useful technique to save memory. For instance, the CGA's 320 × 200 resolution mode can show only four of the 16 colors at one time. As the palettes are entirely proprietary, an image generated on one platform cannot be directly viewed properly on another. Other machines of this era had the ability to generate a larger set of colors, but generally only allowed a subset of those to be used in any one image. Examples include the 256-color palette on Atari 8-bit computers with their GITA chip or the 64 colors of the VT241 terminal in ReGIS graphics mode. In these cases, a small subset of the total number of colors could be displayed at one time, four, for example, on the VT241. Architecturally, these systems worked similarly to their less colorful brethren, but a key difference was that there were too many colors in the palette to directly encode in the pixel data, given the limited amount of video memory. Instead, they used a color look-up table (CLUT) where each pixel's data pointed to an entry in the CLUT, and the CLUT was set up under program control. This meant that the image CLUT data had to be stored along with the raw image data in order to be able to reproduce the image correctly.
… excerpt ends here. Continue reading the full article.






