Indexed color

In computer graphics is called indexed color a method for storing a raster graphics. For indexed colors, the data structure of each pixel does not directly contain the individual color values, but only an index to an entry of a so-called color table or color palette that lists the colors used in the image. A pixel stores this - in place of the color value - the number of the table entry, which contains this color value. Images that contain only a few different colors, save by the small size of the color index a space. In particular, simple graphics or diagrams can be saved as a space-saving. Indexed colors are both various graphics formats as well as old video standards such as EGA and VGA, use.

Operation

In the color table all the colors used in the image are listed, each entry containing a color value. The color table is stored by the pixel data separated. The space that the index of a pixel is required is specified in bits per pixel ( bpp ) and is a measure of the so-called color depth of the image. The color depth limits the maximum number of usable table entries; on an image with indexed colors by bpp results in a maximum size of color table entries.

In practice, only a maximum of 8 bpp are used in accordance with a table size of 256 colors. In theory, color tables with more than 8 bpp are possible. However, the memory savings decreases with increasing size of the color table; above a certain size, the memory requirement is a total of even greater than with directly specified colors.

The number of table entries is independent of the format in which the color values ​​are ultimately represented in the table entries; for these are arbitrary color spaces possible. In practice, either the 8-bit grayscale values, or 8 bits each for red, green and blue (RGB), may additionally also an alpha value indicating the transparency used. It is sometimes referred to with the term " color depth " and the value of a color space occupied; this meaning should be distinguished from the color depth in terms of storage space used for the color index.

Often the number of colors of a raster graphic is artificially reduced to 256 colors or less, to benefit from the lower memory requirements of indexed colors. This method, in which the most representative for the image colors must be determined, is called color reduction.

Example

The above scheme illustrates the operation of the color table example of a 5 × 5 -pixel image at 2 bpp, 22 = 4 corresponding table entries dar. Each pixel contains an index to the color table which defines the respective color value. On the right, the same image can be seen without a color table; the color values ​​here are stored directly in the pixels.

Assuming that a color is represented by three RGB values ​​of 8 bits each for this image,

  • The result for the image without color table size of the image data of ( 5 × 5) × (3 × 8) = 600 bits.
  • In the image with color Table latter 4 × (3 × 8) = 96-bit; the size of the image data is given by (5 × 5) × 2 = 50 bits. The whole picture is in this case only 96 50 = 146 bits in size.

Color Lookup Table

As a Color Lookup Table (CLUT, see also lookup table) is the portion of the graphics hardware, which converts the indexed colors of the framebuffer in normal color values ​​in order to spend it on a screen can. The CLUT is thus realized by hardware color table. The first graphics cards the CLUT was ROM -like hard-wired, today it usually involves a quick memory or set of registers in the graphics hardware that contains the color table currently in use.

Most graphics formats, define the format of a stored image file, support different color depths, including both those without pallet as well as those with pallet. In the latter, then there is a section for the color table, which is then sometimes called " (Color) Look-Up Table " or similar.

Color table rotation

Since the current color table of a hardware CLUT can be changed by moving gradients are very quick and simple graphical effects possible ( color table rotation, colorcycling ). This is typically a sub- range of the color palette with a constant repetition rate is reassigned cyclically, ie " scrolled ". This particular effect can be achieved such as moving water. The cost of the processor is very low since it only the contents of a few color registers in the graphics hardware must remap from one to the next phase and not access the much larger actual graphics memory needs. According to this approach was particularly common in the early days of home computers, as yet was not so great computational power available.

The color table rotation was already in Super Paint, a mid-1970s developed paint program possible. The Amiga IFF file format is particularly suitable for storing complex color table rotation effects within graphic files and animations. The dynamically changing range of areas as well as the time parameters are specified in their own data " chunks " ( CCRT, CRNG or DRNG ). These chunks support asynchronous rotation range of several areas at different speeds and directions. Various Atari paint programs such as Neochrome allow color table rotation effects for a given range area. The splash screens for Microsoft Windows 95 and 98 also used Color Chart rotation. Here the image to a file in BMP format was stored; an entry in the header of certain the number of rotating palette entries.

In conventional computers today such possibilities but hardly used, as modern graphics cards work in true color mode and are fast enough to achieve the same effects in this display.

194800
de