Indexed Color
   HOME

TheInfoList



OR:

In computing, indexed color is a technique to manage
digital image A digital image is an image composed of picture elements, also known as ''pixels'', each with ''finite'', '' discrete quantities'' of numeric representation for its intensity or gray level that is an output from its two-dimensional functions ...
s' colors in a limited fashion, in order to save computer
memory Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembered, ...
and
file storage In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
, while speeding up display refresh and file transfers. It is a form of vector quantization compression. When an image is
encoded In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form, sometimes shortened or secret, for communication through a communication ...
in this way, color information is not directly carried by the image
pixel In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a raster image, or the smallest point in an all points addressable display device. In most digital display devices, pixels are the smal ...
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. Each image pixel does not contain the full specification of its color, but 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 buffer A framebuffer (frame buffer, or sometimes framestore) is a portion of random-access memory (RAM) containing a bitmap that drives a video display. It is a memory buffer containing data representing all the pixels in a complete video frame. Modern ...
s and color lookup tables include Shoup's
SuperPaint SuperPaint was a pioneering graphics program and framebuffer computer system developed by Richard Shoup at Xerox PARC. The system was first conceptualized in late 1972 and produced its first stable image in April 1973. SuperPaint was among the e ...
(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 Random access (more precisely and more generally called direct access) is the ability to access an arbitrary element of a sequence in equal time or any datum from a population of addressable elements roughly as easily and efficiently as any othe ...
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 A graphics card (also called a video card, display card, graphics adapter, VGA card/VGA, video adapter, display adapter, or mistakenly GPU) is an expansion card which generates a feed of output images to a display device, such as a computer mo ...
hardware, so it is not a coincidence that those numbers are exact powers of two (the
binary code A binary code represents text, computer processor instructions, or any other data using a two-symbol system. The two-symbol system used is often "0" and "1" from the binary number system. The binary code assigns a pattern of binary digits, also ...
): 22 = 4, 24 = 16 and 28 = 256. While 256 values can be fit into a single 8-
bit The bit is the most basic unit of information in computing and digital communications. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represente ...
byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit ...
(and then a single indexed color pixel also occupies a single byte), pixel indices with 16 (4-bit, a
nibble In computing, a nibble (occasionally nybble, nyble, or nybl to match the spelling of byte) is a four-bit aggregation, or half an octet. It is also known as half-byte or tetrade. In a networking or telecommunication context, the nibble is oft ...
) 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 image A binary image is one that consists of pixels that can have one of exactly two colors, usually black and white. Binary images are also called ''bi-level'' or ''two-level'', Pixelart made of two colours is often referred to as ''1-Bit'' or ''1b ...
s'' (sometimes referred as a ''bitmap'' or ''bilevel image'') and not an indexed color image. If simple
video overlay {{Distinguish, on-screen display Video overlay is any technique used to display a video window on a computer display while bypassing the chain of CPU to graphics card to computer monitor. This is done in order to speed up the video display, and it ...
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-bit per pixel, 4,096 different indices. To use indexed 16 bpp or more does not provide the benefits of the indexed color images' nature, due to the color palette size in bytes being greater than the raw image data itself. Also, useful direct RGB
Highcolor High color graphics is a method of storing image information in a computer's memory such that each pixel is represented by two bytes. Usually the color is represented by all 16 bits, but some devices also support 15-bit high color. More recentl ...
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 In computer graphics, color quantization or color image quantization is quantization applied to color spaces; it is a process that reduces the number of distinct colors used in an image, usually with the intention that the new image should be as v ...
. Such a palette is frequently insufficient to represent the image accurately; difficult-to-reproduce features such as
gradient In vector calculus, the gradient of a scalar-valued differentiable function of several variables is the vector field (or vector-valued function) \nabla f whose value at a point p is the "direction and rate of fastest increase". If the gradi ...
s will appear blocky or as strips ('' color banding''). In those cases, it is usual to employ
dither Dither is an intentionally applied form of image noise, noise used to randomize quantization error, preventing large-scale patterns such as color banding in images. Dither is routinely used in processing of both digital audio and digital vide ...
ing, 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 Personal may refer to: Aspects of persons' respective individualities * Privacy * Personality * Personal, personal advertisement, variety of classified advertisement used to find romance or friendship Companies * Personal, Inc., a Washington, ...
and home computers had very limited hardware palettes that could produce a very small set of colors. In these cases, each pixel's value mapped directly onto one of these colors. Well-known examples include the
Apple II The Apple II (stylized as ) is an 8-bit home computer and one of the world's first highly successful mass-produced microcomputer products. It was designed primarily by Steve Wozniak; Jerry Manock developed the design of Apple II's foam-m ...
,
Commodore 64 The Commodore 64, also known as the C64, is an 8-bit home computer introduced in January 1982 by Commodore International (first shown at the Consumer Electronics Show, January 7–10, 1982, in Las Vegas). It has been listed in the Guinness ...
and IBM PC CGA, all of which included hardware that could 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 could show only four of the 16 colors at one time. As the palettes were 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 machines or the 4,096 colors of the
VT241 VT or Vt may refer to: Businesses and organizations * Verlag Technik, a former German publishing house * VT F.C. (Vospers Thornycroft FC), a UK football club * VT Group, a British defence company * Air Tahiti (IATA airline designator VT), a Frenc ...
terminal in
ReGIS Regis or Régis may refer to: People * Regis (given name), a given name (including a list of people with the name) * Regis (surname), a surname (including a list of people with the name) * Regis (musician), full name Karl O'Connor, an Englis ...
graphics mode. In these cases it was common for the image to only allow a small subset of the total number of colors to be displayed at one time, up to 16 at once on the Atari and VT241. Generally, these systems worked identically 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 Dynamic random-access memory (dynamic RAM or DRAM) is a type of random-access semiconductor memory that stores each bit of data in a memory cell, usually consisting of a tiny capacitor and a transistor, both typically based on metal-oxide ...
. Instead, they used a
colour look-up table In computer graphics, a palette is the set of available colors from which an image can be made. In some systems, the palette is fixed by the hardware design, and in others it is dynamic, typically implemented via a color lookup table (CLUT), ...
(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 re-produce the image correctly.


RGB

Hardware palettes based on
component video Component video is an analog video signal that has been split into two or more component channels. In popular use, it refers to a type of component analog video (CAV) information that is transmitted or stored as three separate signals. Compon ...
colors such as
YPbPr YPbPr or Y'PbPr, also written as , is a color space used in video electronics, in particular in reference to component video cables. YPBPR is gamma corrected YCBCR color space (it is not analog YUV that was used for analog TV, though component ...
or the like were generally replaced in the mid 1980s by the more flexible
RGB color model The RGB color model is an additive color model in which the red, green and blue primary colors of light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three additiv ...
, in which a given color can be obtained by mixing different amounts of the three
primary color A set (mathematics), set of primary colors or primary colours (see American and British English spelling differences#-our, -or, spelling differences) consists of colorants or colored lights that can be mixed in varying amounts to produce a gamu ...
s red, green, and blue. Although the total number of different colors depends on the number of levels per primary, and on a given hardware implementation (a 9-bit RGB provides 512 combinations, a 12-bit RGB provides 4,096, and so on), in this model
Digital-to-Analog Converter In electronics, a digital-to-analog converter (DAC, D/A, D2A, or D-to-A) is a system that converts a digital signal into an analog signal. An analog-to-digital converter (ADC) performs the reverse function. There are several DAC architec ...
s (DAC) can generate the colors — simplifying the hardware design — while the software can treat the number per levels used abstractly and manage the RGB colors in a device-independent fashion. With colors stored in RGB format within the palettes of indexed image files, any image can be displayed (through appropriate transformations) on any such system, regardless of the color depth used in the hardware implementation. Today, display hardware and
image file formats An Image file format is a file format for a digital image. There are many formats that can be used, such as JPEG, PNG, and GIF. Most formats up until 2022 were for storing 2D images, not 3D ones. The data stored in an image file format may be c ...
that deal with indexed color images almost exclusively manage colors in RGB format, the de facto standard encoding being the so-called truecolor or 24-bit RGB, with 16,777,216 different possible colors. However, indexed color images are not genuinely constrained to a 24-bit RGB color encoding; image palettes can hold any type of color encoding. For example, the
PDF Portable Document Format (PDF), standardized as ISO 32000, is a file format developed by Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, hardware, and operating systems. ...
file format does support indexed color in other colorspaces, notably
CMYK The CMYK color model (also known as process color, or four color) is a subtractive color model, based on the CMY color model, used in color printing, and is also used to describe the printing process itself. The abbreviation ''CMYK'' refers ...
, and
Adobe Distiller Adobe Acrobat Distiller is a software application for converting documents from PostScript format to Adobe PDF (Portable Document Format), the native format of the Adobe Acrobat family of products. It was first shipped as a component of Acrobat ...
by default will convert images to indexed color whenever the total number of colors in an image is equal to or less than 256. When using RGB, the
TIFF Tag Image File Format, abbreviated TIFF or TIF, is an image file format for storing raster graphics images, popular among graphic artists, the publishing industry, and photographers. TIFF is widely supported by scanning, faxing, word processin ...
and PNG file formats can optionally store the RGB triplets with a precision of 16-bit (65,536 levels per component) yielding a total of 48 bits per pixel. A proposed extension to the TIFF Standard allows non-RGB color palettes, but this was never implemented in software due to technical reasons. The color map table of the
BMP file format The BMP file format, also known as bitmap image file, device independent bitmap (DIB) file format and bitmap, is a raster graphics image file format used to store bitmap digital images, independently of the display device (such as a graphics adapt ...
indexed color mode stores its entries in BGR order rather than RGB, and has (in the current version) an additional unused byte for padding to conform to
32-bit In computer architecture, 32-bit computing refers to computer systems with a processor, memory, and other major system components that operate on data in 32-bit units. Compared to smaller bit widths, 32-bit computers can perform large calculation ...
word alignment during processing, but it is essentially still a 24-bit RGB color encoding. (An earlier version of the BMP format used three bytes per 24-bit color map table entry, and many files in that format are still in circulation, so many modern programs that read BMP files support both variations.)


Pixel bits arrangements

Except for very low resolution graphic modes, early home and personal computers rarely implemented an "all-pixels-addressable" design - that is, the ability to change a single pixel to any of the available colors independently. Their limitations came from employing separate ''color attribute'' or ''color RAM'' areas, leading to
attribute clash Attribute may refer to: * Attribute (philosophy), an extrinsic property of an object * Attribute (research), a characteristic of an object * Grammatical modifier, in natural languages * Attribute (computing), a specification that defines a proper ...
effects. Also, the pixel bits and/or the scan lines of the video memory were commonly arranged in odd ways convenient for the video generator hardware (thus saving hardware costs in a cost-competitive market), but sometimes creating difficulty for the people writing graphics programs. A pixel's bits in indexed-color, all-pixel-addressable images are not always contiguous in video memory or image files (i.e., chunky organization is not always used.) Some video hardware, such as the 16-color graphic modes of the
Enhanced Graphics Adapter The Enhanced Graphics Adapter (EGA) is an IBM PC graphics adapter and de facto computer display standard from 1984 that superseded the CGA standard introduced with the original IBM PC, and was itself superseded by the VGA standard in 1987. In ...
(EGA) and
Video Graphics Array Video Graphics Array (VGA) is a video display controller and accompanying de facto graphics standard, first introduced with the IBM PS/2 line of computers in 1987, which became ubiquitous in the PC industry within three years. The term can now ...
(VGA) for
IBM PC compatible IBM PC compatible computers are similar to the original IBM PC, XT, and AT, all from computer giant IBM, that are able to use the same software and expansion cards. Such computers were referred to as PC clones, IBM clones or IBM PC clones. ...
s or the
Amiga Amiga is a family of personal computers introduced by Commodore in 1985. The original model is one of a number of mid-1980s computers with 16- or 32-bit processors, 256 KB or more of RAM, mouse-based GUIs, and significantly improved graphi ...
video buffer Inc. Commodore-Amiga, Amiga Hardware Reference Manual, 1991, Addison-Wesley. are arranged as a series of
bit plane A bit plane of a digital discrete signal (such as image or sound) is a set of bits corresponding to a given bit position in each of the binary numbers representing the signal. For example, for 16-bit data representation there are 16 bit plane ...
s (in a configuration called
planar Planar is an adjective meaning "relating to a plane (geometry)". Planar may also refer to: Science and technology * Planar (computer graphics), computer graphics pixel information from several bitplanes * Planar (transmission line technologies), ...
), in which the related bits of a single pixel are split among several independent
bitmap In computing, a bitmap is a mapping from some domain (for example, a range of integers) to bits. It is also called a bit array A bit array (also known as bitmask, bit map, bit set, bit string, or bit vector) is an array data structure that c ...
s. Thus, the pixel bits are conceptually aligned along the 3D Z-axis. (The "depth" concept here is not the same as that of pixel depth.) Early image file formats, such as PIC, stored little more than a bare
memory dump In computing, a core dump, memory dump, crash dump, storage dump, system dump, or ABEND dump consists of the recorded state of the working memory of a computer program at a specific time, generally when the program has crashed or otherwise termina ...
of the video buffer of a given machine. Some indexed-color image file formats such as
Graphics Interchange Format The Graphics Interchange Format (GIF; or , see pronunciation) is a bitmap image format that was developed by a team at the online services provider CompuServe led by American computer scientist Steve Wilhite and released on 15 June 1987. ...
(GIF) allow the image's scan lines to be arranged in interleaved fashion (not linear order), which allows a low resolution version of the image to appear on screen while it is still downloading, so that the computer user can gain an idea of its contents during the seconds before the whole image arrives. Here is an example of a typical vertically interleaved download in four steps: As seen here, the image has been divided into four groups of lines: group A contains every fourth line, group B contains lines immediately following ones in group A, group C likewise contains the lines immediately following those in group B, and group D contains the remaining lines, which are between group C lines (immediately above) and group A lines (immediately below). These are stored into the file in the order A, C, B, D, so that when the file is transmitted the second received group (C) of lines lie centered between the lines of the first group, yielding the most spatially uniform and recognizable image possible, composed of only two of the groups of lines. The same technique can be applied with more groups (e.g. eight), in which case at each step the next group to be sent contains lines lying at or near the centers of remaining bands that are not yet filled with image data. This method, with four or eight groups of lines, was commonly used on the early World Wide Web during the second half of the 1990s. Rather than leaving the background (black) showing as in the illustration above, the partial image was often presented on screen by duplicating each line to fill the space below it down to the next received image line. The end result was a continuous image with decreased vertical resolution that would increase to full resolution over a few seconds as the later parts of the image data arrived.


Advantages

Indexed color saves a lot of memory, storage space, and transmission time: using truecolor, each pixel needs 24 bits, or 3 bytes. A typical 640×480
VGA Video Graphics Array (VGA) is a video display controller and accompanying de facto graphics standard, first introduced with the IBM PS/2 line of computers in 1987, which became ubiquitous in the PC industry within three years. The term can no ...
resolution truecolor uncompressed image needs 640×480×3 = 921,600 bytes (900 KiB). Limiting the image colors to 256, every pixel needs only 8 bits, or 1 byte each, so the example image now needs only 640×480×1 = 307,200 bytes (300 KiB), plus 256×3 = 768 additional bytes to store the palette map in itself (assuming RGB), approximately one third of the original size. Smaller palettes (4-bit 16 colors, 2-bit 4 colors) can pack the pixels even more (to one sixth or one twelfth), obviously at cost of color accuracy. Indexed color was widely used in early
personal computer A personal computer (PC) is a multi-purpose microcomputer whose size, capabilities, and price make it feasible for individual use. Personal computers are intended to be operated directly by an end user, rather than by a computer expert or tec ...
s and display adapters' hardware to reduce costs (mainly by requiring fewer of the then-expensive
RAM Ram, ram, or RAM may refer to: Animals * A male sheep * Ram cichlid, a freshwater tropical fish People * Ram (given name) * Ram (surname) * Ram (director) (Ramsubramaniam), an Indian Tamil film director * RAM (musician) (born 1974), Dutch * ...
chips ''CHiPs'' is an American crime drama television series created by Rick Rosner and originally aired on NBC from September 15, 1977, to May 1, 1983. It follows the lives of two motorcycle officers of the California Highway Patrol (CHP). The serie ...
) but also for convenient image management with limited-power CPUs (of the order of 4 to 8
MHz The hertz (symbol: Hz) is the unit of frequency in the International System of Units (SI), equivalent to one event (or cycle) per second. The hertz is an SI derived unit whose expression in terms of SI base units is s−1, meaning that one he ...
), file storage (
cassette tape The Compact Cassette or Musicassette (MC), also commonly called the tape cassette, cassette tape, audio cassette, or simply tape or cassette, is an analog magnetic tape recording format for audio recording and playback. Invented by Lou Ottens ...
s and low density
floppy disk A floppy disk or floppy diskette (casually referred to as a floppy, or a diskette) is an obsolescent type of disk storage composed of a thin and flexible disk of a magnetic storage medium in a square or nearly square plastic enclosure lined w ...
s). Notable computer graphics systems extensively (or even exclusively) using pseudocolor palettes in the 1980s include CGA, EGA, and VGA (for
IBM PC compatible IBM PC compatible computers are similar to the original IBM PC, XT, and AT, all from computer giant IBM, that are able to use the same software and expansion cards. Such computers were referred to as PC clones, IBM clones or IBM PC clones. ...
s), the
Atari ST The Atari ST is a line of personal computers from Atari Corporation and the successor to the Atari 8-bit family. The initial model, the Atari 520ST, had limited release in April–June 1985 and was widely available in July. It was the first pers ...
, and
Amiga Amiga is a family of personal computers introduced by Commodore in 1985. The original model is one of a number of mid-1980s computers with 16- or 32-bit processors, 256 KB or more of RAM, mouse-based GUIs, and significantly improved graphi ...
's OCS and
AGA Aga or AGA may refer to: Business * Architectural Glass and Aluminum (AGA), a glazing contractor, established in 1970 * AGA (automobile), ''Autogen Gasaccumulator AG'', 1920s German car company *AGA AB, ''Aktiebolaget Svenska Gasaccumulator'', a ...
. Image files exchanged over the
CompuServe CompuServe (CompuServe Information Service, also known by its initialism CIS) was an American online service provider, the first major commercial one in the world – described in 1994 as "the oldest of the Big Three information services (the oth ...
net in the early 1990s were encapsulated in the
GIF The Graphics Interchange Format (GIF; or , see pronunciation) is a bitmap image format that was developed by a team at the online services provider CompuServe led by American computer scientist Steve Wilhite and released on 15 June 1987. ...
format. Later, the
HTML The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScri ...
web pages used the GIF along with other indexed color-supporting file formats such as PNG, to exchange limited-color images quickly and store them in limited storage space. Most
image file formats An Image file format is a file format for a digital image. There are many formats that can be used, such as JPEG, PNG, and GIF. Most formats up until 2022 were for storing 2D images, not 3D ones. The data stored in an image file format may be c ...
that support indexed color images also commonly support some
compression Compression may refer to: Physical science *Compression (physics), size reduction due to forces *Compression member, a structural element such as a column *Compressibility, susceptibility to compression * Gas compression *Compression ratio, of a ...
scheme, enhancing their ability to store the images in smaller files. Interesting colorized and artistic effects can be easily achieved by altering the color palette of indexed color images, for example to produce colorized
sepia tone In photography, toning is a method of altering the color of black-and-white photographs. In analog photography, it is a chemical process carried out on metal salt-based prints, such as silver prints, iron-based prints (cyanotype or Van Dyke b ...
images. Due to the separate nature of the associated palette element of the indexed color images, they are ideal to remap
grayscale In digital photography, computer-generated imagery, and colorimetry, a grayscale image is one in which the value of each pixel is a single sample representing only an ''amount'' of light; that is, it carries only intensity information. Graysca ...
images into
false color False color (or pseudo color) refers to a group of color rendering methods used to display images in color which were recorded in the visible or non-visible parts of the electromagnetic spectrum. A false-color image is an image that depicts ...
ones through the use of false color palettes. Simple
video overlay {{Distinguish, on-screen display Video overlay is any technique used to display a video window on a computer display while bypassing the chain of CPU to graphics card to computer monitor. This is done in order to speed up the video display, and it ...
can be achieved easily through the transparent color technique. By manipulating the color hardware registers ( Color look-up table or CLUT) of the display adapter in the indexed color graphic modes, full-screen color-animation effects can be achieved without redrawing the image - that is, at low CPU time cost; a single change of the register values affects the whole screen at once. Color-map animation, also known as
Color cycling Color cycling, also known as palette shifting, is a technique used in computer graphics in which colors are changed in order to give the impression of animation. This technique was mainly used in early computer games, as storing one image and cha ...
, is extensively used in the
demoscene The demoscene is an international computer art subculture focused on producing demos: self-contained, sometimes extremely small, computer programs that produce audiovisual presentations. The purpose of a demo is to show off programming, visual ...
. The Microsoft Windows boot logo screen in Windows 95, 98, ME, and 2000 Professional (which uses VGA 320x200x256 color display mode because it is the greatest common denominator on all PCs) employs this technique for the scrolling gradient bar across the bottom of the screen; the picture is a static image with no pixels rewritten after it is initially displayed. Custom boot screen images could tap the cycled colors to animate other parts of the images.


Disadvantages

The main disadvantage of using indexed color is the limited set of simultaneous colors per image. Small 4- or 16-color palettes are still acceptable for little images (
icons An icon () is a religious work of art, most commonly a painting, in the cultures of the Eastern Orthodox, Oriental Orthodox, and Catholic churches. They are not simply artworks; "an icon is a sacred image used in religious devotion". The most ...
) or very simple graphics, but to reproduce real life images they become nearly useless. Some techniques, such as
color quantization In computer graphics, color quantization or color image quantization is quantization applied to color spaces; it is a process that reduces the number of distinct colors used in an image, usually with the intention that the new image should be as v ...
,
anti-aliasing Anti-aliasing may refer to any of a number of techniques to combat the problems of aliasing in a sampled signal such as a digital image or digital audio recording. Specific topics in anti-aliasing include: * Anti-aliasing filter, a filter used be ...
and
dithering Dither is an intentionally applied form of noise used to randomize quantization error, preventing large-scale patterns such as color banding in images. Dither is routinely used in processing of both digital audio and video data, and is often ...
combined together can create indexed 256-color images comparable to the original up to an acceptable level. : Indexed color images are heavily dependent on their own color palettes. Except for a few well known fixed-color palettes (such as that of the
Color Graphics Adapter The Color Graphics Adapter (CGA), originally also called the ''Color/Graphics Adapter'' or ''IBM Color/Graphics Monitor Adapter'', introduced in 1981, was IBM's first color graphics card for the IBM PC and established a de facto computer display ...
—CGA), raw image data and/or color map tables cannot be reliably exchanged between different image files without some kind of intermediate mapping. Also, if the original color palette for a given indexed image is lost, it can be nearly impossible to restore it. Here is an example of what happens when an indexed color image (the previous parrot) has been associated with an incorrect color palette: : Indexed color graphic modes for display adapters have the 16- or 256-color limit imposed by hardware. Indexed color images with rich but incompatible palettes can only be accurately displayed one at a time, as in a
slideshow A slide show (slideshow) is a presentation of a series of still images ( slides) on a projection screen or electronic display device, typically in a prearranged sequence. The changes may be automatic and at regular intervals or they may be manu ...
. When it is necessary to show multiple images together, as in a mosaic of
thumbnail Thumbnails are reduced-size versions of pictures or videos, used to help in recognizing and organizing them, serving the same role for images as a normal text index does for words. In the age of digital images, visual search engines and image ...
s, a common or '' master palette'' is often used, which encompasses as many different hues as possible into a single set, thereby limiting the overall accurate color availability. The following image is a mosaic of four different indexed color images rendered with a single shared ''master palette'' of 6-8-5 levels RGB plus 16 additional grays. Note the limited range of colors used for every image, and how many palette entries are left unused. : Many indexed color display devices do not reach the 24-bit limit for the full RGB palette. The
VGA Video Graphics Array (VGA) is a video display controller and accompanying de facto graphics standard, first introduced with the IBM PS/2 line of computers in 1987, which became ubiquitous in the PC industry within three years. The term can no ...
for IBM PC compatibles, for example, only provides an 18-bit RGB palette with 262,144 different possible colors in both 16- and 256- indexed color graphic modes. Some image editing software allows
gamma correction Gamma correction or gamma is a nonlinear operation used to encode and decode luminance or tristimulus values in video or still image systems. Gamma correction is, in the simplest cases, defined by the following power-law expression: : V_\text = ...
to be applied to a palette for indexed color image files. In general, to apply a gamma correction directly to the color map is bad practice, due to the original RGB color values being lost. It is better to apply the gamma correction with the display hardware (most modern display adapters support this feature), or as an active intermediate step of the rendering software through
color management In digital imaging systems, color management (or colour management) is the controlled conversion between the color representations of various devices, such as image scanners, digital cameras, monitors, TV screens, film printers, computer printer ...
, which preserves the original color values. Only when the indexed color images are intended for systems that lack any kind of
color calibration The aim of color calibration is to measure and/or adjust the color response of a device (input or output) to a known state. In International Color Consortium (ICC) terms, this is the basis for an additional color characterization of the device ...
, and they are not intended to be cross-platform, gamma correction may be applied to the color table itself.


Image file formats supporting indexed color

These are some of the most representative image file formats that support indexed color modes. Some of these support other modes (e.g. truecolor), but only the indexed color modes are listed here. :''NOTE: most of the formats will also support a color table with fewer colors than the maximum that a given bit depth can offer.'' :''* 64- (true, not EHB), 128- and 256-color modes only available for the AGA Amiga chipset.'' :''** Native support for proprietary compression schemes.'' :''*** RLE with optional proprietary Delta-leaps.''


Notes


See also

*
Color depth Color depth or colour depth (see spelling differences), also known as bit depth, is either the number of bits used to indicate the color of a single pixel, or the number of bits used for each color component of a single pixel. When referring to ...
*
List of palettes This article is a list of the color palettes for notable computer graphics, terminals and video game console hardware. Only a sample and the palette's name are given here. More specific articles are linked from the name of each palette, for the ...
*
List of home computers by video hardware This is a list of home computers, sorted alphanumerically, which lists all relevant details of their video hardware. Home computers are the second generation of desktop computers, entering the market in 1977 and becoming common during the 1980s. ...


References

* Julio Sanchez and Maria P. Canton (2003). ''The PC Graphics Handbook.'' CRC Press. {{ISBN, 0-8493-1678-2.


External links


Introduction to indexed color images
Color Computer graphics data structures Computing output devices