All Topics  
Indexed color

 

   Email Print
   Bookmark   Link






 

Indexed color



 
 
In computing, indexed color is a technique to manage digital image
Digital image

A digital image is a representation of a two-dimensional using ones and zeros . Depending on whether or not the is fixed, it may be of vector graphics or raster graphics type....
s' colors in a limited fashion, in order to save computer's memory and file storage, while speeding up display refresh and telecom transfers. When an image is encoded
Encoding

Encoding is the process of transforming information from one format into another. The opposite operation is called decoding.There are a number of more specific meanings that apply in certain contexts:...
 this way, the color information is not directly carried by the image pixel
Pixel

In digital imaging, a pixel is the smallest item of information in an image. Pixels are normally arranged in a 2-dimensional grid, and are often represented using dots, squares, or rectangles....
 data, but it is stored into a separate piece of data called a palette
Palette (computing)

In computer graphics, a palette is either a given, finite set of colors for the management of digital images , or a small on-screen graphical element for choosing from a limited set of choices, not necessarily colors ....
: an array of color elements, in which every element, a color, is indexed by its position within the array.






Discussion
Ask a question about 'Indexed color'
Start a new discussion about 'Indexed color'
Answer questions from other users
Full Discussion Forum



Encyclopedia


Indexed Palette
In computing, indexed color is a technique to manage digital image
Digital image

A digital image is a representation of a two-dimensional using ones and zeros . Depending on whether or not the is fixed, it may be of vector graphics or raster graphics type....
s' colors in a limited fashion, in order to save computer's memory and file storage, while speeding up display refresh and telecom transfers. When an image is encoded
Encoding

Encoding is the process of transforming information from one format into another. The opposite operation is called decoding.There are a number of more specific meanings that apply in certain contexts:...
 this way, the color information is not directly carried by the image pixel
Pixel

In digital imaging, a pixel is the smallest item of information in an image. Pixels are normally arranged in a 2-dimensional grid, and are often represented using dots, squares, or rectangles....
 data, but it is stored into a separate piece of data called a palette
Palette (computing)

In computer graphics, a palette is either a given, finite set of colors for the management of digital images , or a small on-screen graphical element for choosing from a limited set of choices, not necessarily colors ....
: an array of color elements, in which every element, a color, is indexed by its position within the array. This way, each pixel does not contain the full information to represent its color, but only its index into the palette. This technique is sometimes referred as pseudocolor or indirect color, as colors are addressed indirectly.

The palette size


The palette in itself stores a very limited number of distinct colors, up to 4, 16 or 256 are the most common cases. These limits are often imposed by the target architecture's display adapter
Video card

A video card, also known as a graphics accelerator card, display adapter, or graphics card, is an expansion card whose function is to generate and output images to a display....
 hardware
Computer hardware

A personal computer is made up of computer hardware, multiple physical components onto which can be loaded into a multitude of software that perform the functions of the computer....
 to which the indexed color image is intended to, so it is not a surprise that those numbers are actually exact powers of two (the binary
Binary

Binary means composed of two parts or two pieces. It contrasts with Unary, Ternary, Quaternary , and so on.Binary may also refer to:* Binary option, also known as digital option OR all-or-nothing option...
 code): 22 = 4, 24 = 16 and 28 = 256. While 256 values can be fitted into a single 8-bit
Bit

A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
 byte
Byte

A byte is a basic unit of measurement of Computer storage in computer science. In many computer architectures it is a Byte addressing memory address space....
 (and then a single indexed color pixel occupies a single byte), pixel indices ranging 16 values (4-bit, a nibble
Nibble

A nibble is the computing term for a four-bit aggregation, or half an octet . As a nibble contains 4 bits, there are sixteen possible values, so a nibble corresponds to a single hexadecimal digit ....
) and lesser number of colors can be packed together into a single byte (two nibbles per byte if 16 colors are employed and four 2-bit pixels per byte if using 4 colors). Sometimes, a mere 1-bit per pixel (bpp), 2-color values can be used and then up to eight pixels can be packed into a single byte, but when such colors are black and white, then the image is considered a binary image
Binary image

A binary image is a digital image that has only two possible values for each pixel. Typically the two colors used for a binary image are black and white though any two colors can be used....
 (sometimes referred as a bitmap or bilevel image) and not an indexed color image.

In order to save even more space, some indexed color image file
Image file formats

Image file formats are standardized means of organizing and storing images. This entry is about digital image formats used to store photographic and other images; ....
s can store only the effectively used colors in a given image and not the whole of the palette entries available for the pixel depth employed. Thus, it is not rare to find odd palette sizes of any number between 3 and 255 entries instead of always 256 (for 8 bpp) in such files.

If simple video overlay
Video overlay

Video overlay is any technique used to display a video window on a computer display while bypassing the chain of Central processing unit -> graphics card -> computer monitor....
 is intended through a transparent color
Palette (computing)

In computer graphics, a palette is either a given, finite set of colors for the management of digital images , or a small on-screen graphical element for choosing from a limited set of choices, not necessarily colors ....
, one palette entry is specifically reserved for this purpose, and it is discounted as an actual available color. Some machines, as the MSX
MSX

MSX was the name of a standardized home computer architecture in the 1980s. It was a Microsoft-led attempt to create unified standards among hardware makers, conceived by one-time Microsoft Japan executive Kazuhiko Nishi....
 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 may be then greater than the raw image data in itself. Also, useful direct RGB Highcolor modes can be set from 15 bpp
List of monochrome and RGB palettes

This list of monochrome and RGB palettes includes generic repertoires of colors to produce black-and-white and RGB color pictures by a computer's display Computer hardware, not necessarily the total number of such colors that can be simultaneously displayed in a given text or graphic mode of any machine....
 and up.

If a given real life photograph
Photograph

A photograph is an created by light falling on a light-sensitive surface, usually photographic film or an electronic imager such as a Charge-coupled device or a Complementary metal?oxide?semiconductor chip....
 or image has many subtle color shades, it is necessary to select a limited repertoire of colors to approximate the image using color quantization
Color quantization

In computer graphics, color quantization or color image quantization 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 visually similar as possible to the original image....
. Such a palette is frequently insufficient to represent the image accurately; difficult-to-reproduce features such as gradient
Gradient

In vector calculus, the gradient of a scalar field is a vector field which points in the direction of the greatest rate of increase of the scalar field, and whose magnitude is the greatest rate of change....
s will appear blocky or as strips (banding
Banding

Banding refers to a medical procedure which uses elastic bands for constriction. Banding may be used to tie off blood vessels in order to stop bleeding, as in treatment of bleeding varices....
). In those cases, it is usual to employ dither
Dither

Dither is an intentionally applied form of noise, used to randomize quantization error, thereby preventing large-scale patterns such as contouring that are more objectionable than uncorrelated noise....
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


See also List of palettes
List of palettes

This article is a list of the palette s for notable computer graphics, terminals and video game consoles hardware.Only a sample and the palette's name are given here....


How the colors are encoded within the color palette map of a given indexed color image depend also on the target platform.

Early color techniques


Many early personal
Personal computer

A personal computer is any general-purpose computer whose original sales price, size, and capabilities make it useful for individuals, and which is intended to be operated directly by an end user, with no intervening computer operator....
 and home computer
Home computer

A home computer was a class of personal computer entering the market in 1977 and becoming common during the 1980s. They were marketed to consumers as accessible personal computers, more capable than video game consoles....
s had very limited proprietary color palettes
List of palettes

This article is a list of the palette s for notable computer graphics, terminals and video game consoles hardware.Only a sample and the palette's name are given here....
 made up of different color space
Color space

A color model is an abstract mathematical model describing the way colors can be represented as tuples of numbers, typically as three or four values or color components ....
s implemented directly in its own hardware, so the color indices were imposed by the manufacturer, as those of the Apple II
List of 8-bit computer hardware palettes

This is a list of palette s of some of the most popular early 8-bit personal computers and terminals, roughly those manufactured from 1975 to 1985. Although some of them use List of monochrome and RGB palettes#Regular RGB palettes, are more common specific hardware-implemented 4, 16 or more colors palettes: not bit nor level combinations of RGB pri...
 and the Commodore 64
List of 8-bit computer hardware palettes

This is a list of palette s of some of the most popular early 8-bit personal computers and terminals, roughly those manufactured from 1975 to 1985. Although some of them use List of monochrome and RGB palettes#Regular RGB palettes, are more common specific hardware-implemented 4, 16 or more colors palettes: not bit nor level combinations of RGB pri...
. This had the advantage that the mapping between the pixel indices and their correspondent colors was implicit, and then rarely (if ever) the color table was stored as a separate file or as part of an image file.

As display hardware evolved, available hardware palettes grew beyond the maximum single pixel depth
Color depth

Color depth or bit depth, is a computer graphics term describing the number of bits used to represent the color of a single pixel in a Raster graphicsped image or video frame buffer....
 (the number of different values a pixel can hold), so the indexed color images needed to select a limited repertoire of colors from a given wider hardware palette. Thus, the programs must load the image colors into the display's color hardware register
Hardware register

In digital electronics, especially computing, a hardware register stores bits of information, in a way that all the bits can be written to or read out simultaneously....
s (or perform other special settings) before loading the actual image pixels into the video memory, and then the image palette in itself (or the values to set the actual screen colors) must be saved along with the raw image data.

RGB


Hardware palettes based on composite video
Composite video

Composite video is the format of an analog television signal before it is combined with a sound signal and modulation onto an Radio Frequency carrier wave....
 colors such as YPbPr
YPbPr

YPBPR is a color space used in video electronics, in particular in reference to component video cables. YPBPR is the analog signal version of the YCbCr color space; the two are numerically equivalent, but YPBPR is designed for use in analogue electronics whereas YCB
 or the like were generally replaced in the mid 1980s by the more flexible RGB color model
RGB color model

The RGB color model is an additive color in which red, green, and blue light are added together in various ways to reproduce a broad array of colors....
, in which a given color can be obtained by mixing different amounts of three primary color
Primary color

Primary colors are sets of colors that can be combined to make a useful range of colors. For human applications, three are often used; for additive combination of colors, as in overlapping projected lights or in cathode ray tube displays, the primary colors normally used are red, green, and blue....
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
List of monochrome and RGB palettes

This list of monochrome and RGB palettes includes generic repertoires of colors to produce black-and-white and RGB color pictures by a computer's display Computer hardware, not necessarily the total number of such colors that can be simultaneously displayed in a given text or graphic mode of any machine....
 provides 512 combinations, a 12-bit RGB
List of monochrome and RGB palettes

This list of monochrome and RGB palettes includes generic repertoires of colors to produce black-and-white and RGB color pictures by a computer's display Computer hardware, not necessarily the total number of such colors that can be simultaneously displayed in a given text or graphic mode of any machine....
 provides 4,096, and so on), in this model Digital-to-Analog Converter
Digital-to-analog converter

In electronics, a digital-to-analog converter is a device for converting a digital code to an analog signal .An analog-to-digital converter performs the reverse operation....
s (DAC) can generate the colors -- simplifying the hardware design -- while the software can treat of 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, by appropriate software any image can be displayed (through appropriate transformations) on any of such systems, regardless of the color depth used in the hardware implementation.

Today, display hardware and image file formats
Image file formats

Image file formats are standardized means of organizing and storing images. This entry is about digital image formats used to store photographic and other images; ....
 that deal with indexed color images almost exclusively manage colors in RGB format, the de-facto standard encoding being the so-called truecolor
Truecolor

Truecolor is a method of representing and storing graphical image information in an RGB color space such that a very large number of colors, shades, and hues can be displayed in an image, such as in high quality photographic images or complex graphics....
 or 24-bit RGB
RGB color model

The RGB color model is an additive color in which red, green, and blue light are added together in various ways to reproduce a broad array of colors....
, with 16,777,216 different possible colors
List of monochrome and RGB palettes

This list of monochrome and RGB palettes includes generic repertoires of colors to produce black-and-white and RGB color pictures by a computer's display Computer hardware, not necessarily the total number of such colors that can be simultaneously displayed in a given text or graphic mode of any machine....
. 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 file format does support indexed color in other colorspaces, notably CMYK
CMYK color model

CMYK is a subtractive color color model, used in color printing, also used to describe the printing process itself. Though it varies by print house, press operator, press manufacturer and press run, ink is typically applied in the order of the abbreviation....
, and Adobe Distiller by default will convert images to indexed color whenever the total number of colors in an image is less or equal than 256. When using RGB, the TIFF file format 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 actually implemented in software due to technical reasons. The color map table of the BMP file format 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
32-bit

The range of integer values that can be stored in 32 bits is 0 through 4,294,967,295 or -2,147,483,648 through 2,147,483,647 using two's complement encoding....
 word alignment
Data structure alignment

Data structure alignment is the way data is arranged and accessed in computer memory. It consists of two separate but related issues: data alignment and data structure padding....
 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 probably 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 clash

Attribute clash was a display artifact caused by limitations in the graphics circuitry of a number of early colour 8-bit home computers — most notably the Sinclair Research ZX Spectrum....
 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-cometitive 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
Enhanced Graphics Adapter

The Enhanced Graphics Adapter is the IBM PC computer display standard specification located between Color Graphics Adapter and Video Graphics Array in terms of color and space resolution....
 (EGA) and Video Graphics Array
Video Graphics Array

The term Video Graphics Array refers specifically to the display hardware first introduced with the IBM Personal System/2 line of computers in 1987, but through its widespread adoption has also come to mean either an analogue electronics computer display standard, the 15-pin D-subminiature VGA connector or the 640×480 resolution its...
 (VGA) for IBM PC compatible
IBM PC compatible

IBM PC compatible computers are those generally similar to the original IBM Personal Computer, IBM Personal Computer XT, and IBM Personal Computer/AT....
s or the Amiga
Amiga

The Amiga is a family of personal computers originally developed by Amiga Corporation. Development on the Amiga began in 1982 with Jay Miner as the principal hardware designer....
 video buffer are arranged as a series of bit planes (in a configuration called planar
Planar

In computer graphics, planar is the method of representing pixel colours with several bitplanes of Random Access Memory. Each bit in a bitplane is related to one pixel on the screen....
), in which the related bits of a single pixel are split among several independent bitmap
Binary image

A binary image is a digital image that has only two possible values for each pixel. Typically the two colors used for a binary image are black and white though any two colors can be used....
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
Color depth

Color depth or bit depth, is a computer graphics term describing the number of bits used to represent the color of a single pixel in a Raster graphicsped image or video frame buffer....
, though the two concepts are related.)

Early image file formats, as PIC
PICtor PIC image format

PICtor is an graphics file formats developed by John Bridges, the principal author of PCPaint, the first Paintbrush program for the PC. It was also the native file format for Pictor Paint and GRASP and became the first widely accepted MS-DOS imaging standard....
, stored little more than a bare memory dump of the video buffer of a given machine.

Also, some indexed-color image file formats as Graphics Interchange Format (GIF) allow the image's scan lines to be arranged in interleaved fashion (not linear order), which allowed the image to appear on screen little by little while it is still downloading over a low speed communication link (such as an analog telephone modem
Modem

Modem is a peripheral device that modulation an analog carrier wave Signal to encode digital information, and also demodulation such a carrier signal to decode the transmitted information....
) so that the computer user can catch 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 C 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 possible image 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 some 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 of 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. In other words, take the four steps of the example image above, and for each step, copy each horizontal image line down to cover the horizontal black lines below it, making four new images; these are the four images you would see in succession over a few seconds (in the same place, replacing each other like an animation) in a late '90s web browser such as Netscape 3.

Advantages


Indexed color saves a lot of memory/storage space and/or transmission time: using truecolor
Truecolor

Truecolor is a method of representing and storing graphical image information in an RGB color space such that a very large number of colors, shades, and hues can be displayed in an image, such as in high quality photographic images or complex graphics....
, each pixel needs 24 bits, or 3 bytes. A typical 640×480 VGA 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 need only 640×480×1 = 307,200 bytes (300 KiB), plus 256×3 = 768 additional bytes to store the palette map in itself (assuming RGB), approx. one third of the original size. Smaller palettes (4-bit 16 colors, 2-bit 4 colors) can pack the pixels even more (to 1/6 or 1/12), obviously at cost of color accuracy.

Indexed color has been widely used in early personal computer
Personal computer

A personal computer is any general-purpose computer whose original sales price, size, and capabilities make it useful for individuals, and which is intended to be operated directly by an end user, with no intervening computer operator....
s and display adapters' hardware to reduce costs (mainly, fewer then-expensive RAM
Ram

Ram, ram, or RAM as a non-acronymic wordAs a non-acronymic word Ram, ram, or RAM may refer to:...
 chips
Integrated circuit

In electronics, an integrated circuit is a miniaturized electronic circuit that has been manufactured in the surface of a thin Wafer of semiconductor material....
) but also for convenient image management with limited-power CPUs (of the order of 4 to 8 MHz) and file storage (cassette tape
Magnetic tape data storage

Magnetic tape has been used for data storage for over 50 years. In this time, many advances in tape formulation, packaging, and data density have been made....
s and low density floppy disk
Floppy disk

A floppy disk is a data storage medium that is composed of a disk of thin, flexible magnetic storage medium encased in a square or rectangle plastic shell....
s). Notable computer graphics systems extensively (or even exclusively) using pseudocolor palettes in the 1980s include CGA
Color Graphics Adapter

The Color Graphics Adapter , originally also called the Color/Graphics Adapter or IBM Color/Graphics Monitor Adapter, introduced in 1981, was International Business Machines's first color graphics card, and the first color computer display standard for the IBM PC....
, EGA
Enhanced Graphics Adapter

The Enhanced Graphics Adapter is the IBM PC computer display standard specification located between Color Graphics Adapter and Video Graphics Array in terms of color and space resolution....
, and VGA
Video Graphics Array

The term Video Graphics Array refers specifically to the display hardware first introduced with the IBM Personal System/2 line of computers in 1987, but through its widespread adoption has also come to mean either an analogue electronics computer display standard, the 15-pin D-subminiature VGA connector or the 640×480 resolution its...
 (for the IBM PC compatible
IBM PC compatible

IBM PC compatible computers are those generally similar to the original IBM Personal Computer, IBM Personal Computer XT, and IBM Personal Computer/AT....
s), the Atari ST
Atari ST

The Atari ST is a home computer/personal computer that was commercially available from 1985 to the early 1990s. It was released by Atari Corporation in 1985....
, and Amiga
Amiga

The Amiga is a family of personal computers originally developed by Amiga Corporation. Development on the Amiga began in 1982 with Jay Miner as the principal hardware designer....
's OCS
Original Amiga chipset

The Original Chip Set was a chipset used in the earliest Commodore International Amiga computers and defined the Amiga's graphics and sound capabilities....
 and AGA
Advanced Graphics Architecture

Advanced Graphics Architecture is the third generation Amiga graphic chip set, first used in the Amiga 4000 in 1992. AGA was codenamed the Pandora chipset by Commodore International internally....
.

Image files exchanged over the Compuserve
CompuServe

CompuServe, , was the first major commercial online service in the United States. It dominated the field during the 1980s and remained a major player through the mid-1990s, when it was sidelined by the rise of information services such as AOL that charged monthly subscriptions rather than hourly rates....
 net in the early 1990s were encapsulated in the GIF format. Later, the Internet
Internet

The Internet is a global network of interconnected computers, enabling users to share information along multiple channels. Typically, a computer that connects to the Internet can access information from a vast array of available server and other computers by moving information from them to the computer's local memory....
 HTML
HTML

HTML, an Acronym and initialism of HyperText Markup Language, is the predominant markup language for Web pages. It provides a means to describe the structure of text-based information in a document?by denoting certain text as links, headings, paragraphs, lists, and so on?and to supplement that text with interactive forms, embedded '...
 web pages still 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
Image file formats

Image file formats are standardized means of organizing and storing images. This entry is about digital image formats used to store photographic and other images; ....
 that support indexed color images also commonly support some compression
Image compression

Image compression is the application of Data compression on digital images. In effect, the objective is to reduce redundancy of the image data in order to be able to store or data transmission data in an efficient form....
 scheme, enhancing their ability to store the images in smaller files.

Interesting colorized and artistic
List of software palettes

Computer systems that use an 4-bit or 8-bit pixel Color depth can display up to 16 or 256 colors simultaneously. Many personal computers in the early 1990s displayed at most 256 different colors, freely selected by software from their wider hardware's RGB color palette....
 effects can be easily achieved by playing with the color palette of the indexed color images, for example to produce colorized sepia tone images. Due to the separate nature of the associated palette element of the indexed color images, they are ideal to remap grayscale
Grayscale

In photography and computing, a grayscale or greyscale digital image is an image in which the value of each pixel is a single sample , that is, it carries only intensity information....
 images into false color ones through the use of false color palette
List of software palettes

Computer systems that use an 4-bit or 8-bit pixel Color depth can display up to 16 or 256 colors simultaneously. Many personal computers in the early 1990s displayed at most 256 different colors, freely selected by software from their wider hardware's RGB color palette....
s.

Simple video overlay
Video overlay

Video overlay is any technique used to display a video window on a computer display while bypassing the chain of Central processing unit -> graphics card -> computer monitor....
 can be achieved easily through the transparent color
Palette (computing)

In computer graphics, a palette is either a given, finite set of colors for the management of digital images , or a small on-screen graphical element for choosing from a limited set of choices, not necessarily colors ....
 technique.

By manipulating the color hardware registers (Color look-up table or CLUT) of the display adapter in the indexed color graphic modes, interesting full-screen color-animation effects can be achieved without the need of entirely 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 is extensively used in the demoscene
Demoscene

The demoscene is a computer art subculture that specializes in producing Demo , which are non-interactive audio-visual presentations that run in Real-time computing on a computer....
. 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. For example, in the general computing lab sites at Villanova University, they once had a Windows boot screen with a Wildcats logo in which the glowing eyes of the cat would dim and brighten in a pulsing pattern as the progress wave-bar moved.

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
Icon (computing)

On computer displays, a computer icon is a small pictogram. Icons have been used to supplement the normal alphanumerics of the computer. Modern computers now can handle bitmapped graphics on the display terminal, so the icons are widely used to assist users....
) or very simple graphics, but to reproduce real life images it becomes nearly unuseful. Some clever tricks, as color quantization
Color quantization

In computer graphics, color quantization or color image quantization 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 visually similar as possible to the original image....
, anti-aliasing
Anti-aliasing

In digital signal processing, anti-aliasing is the technique of minimizing the distortion artifacts known as aliasing when representing a high-resolution signal at a lower resolution....
 and dithering combined together can approximate indexed 256-color images to the original one up to an acceptable level.

For comparison, here are the same image rendered with a 4-, 16-, and 256-color size with adaptive palette
List of software palettes

Computer systems that use an 4-bit or 8-bit pixel Color depth can display up to 16 or 256 colors simultaneously. Many personal computers in the early 1990s displayed at most 256 different colors, freely selected by software from their wider hardware's RGB color palette....
s (the best picked selected colors) without dithering, (full truecolor version at top):



Indexed color images are heavily dependent of their own color palettes. Except for a few and well known common fixed-color palettes (as that of the Color Graphics Adapter
Color Graphics Adapter

The Color Graphics Adapter , originally also called the Color/Graphics Adapter or IBM Color/Graphics Monitor Adapter, introduced in 1981, was International Business Machines's first color graphics card, and the first color computer display standard for the IBM PC....
—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 near impossible to restore it. Here is an example of what happens when an indexed color image (the previous parrot) has associated 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 once, as in a slideshow
Slideshow

Slideshow is a modern concatenation of "Reversal film Show". A slideshow is a display of a series of chosen images, which is done for artistic or instructional purposes....
. When it is necessary to show multiple images together, as in a mosaic of thumbnail
Thumbnail

Thumbnails are reduced-size versions of pictures, used to help in recognizing and organizing them, serving the same role for images as a normal text index does for words....
s, usually a common or master palette
Palette (computing)

In computer graphics, a palette is either a given, finite set of colors for the management of digital images , or a small on-screen graphical element for choosing from a limited set of choices, not necessarily colors ....
 is used, which encompasses as many different hues as possible into a single set, thus limiting even more the overall accurate color availability.

Here is a mosaic of four different indexed color images rendered with a single shared master palette of 6-8-5 levels RGB
List of software palettes

Computer systems that use an 4-bit or 8-bit pixel Color depth can display up to 16 or 256 colors simultaneously. Many personal computers in the early 1990s displayed at most 256 different colors, freely selected by software from their wider hardware's RGB color palette....
 plus 16 additional grays. Note the limited range of colors used for every image, and how many palette entries left unused.

Many indexed color display devices do not reach the 24-bit limit for the full RGB palette. The VGA
Video Graphics Array

The term Video Graphics Array refers specifically to the display hardware first introduced with the IBM Personal System/2 line of computers in 1987, but through its widespread adoption has also come to mean either an analogue electronics computer display standard, the 15-pin D-subminiature VGA connector or the 640×480 resolution its...
 for IBM PC compatibles, for example, only provides a 18-bit RGB
List of monochrome and RGB palettes

This list of monochrome and RGB palettes includes generic repertoires of colors to produce black-and-white and RGB color pictures by a computer's display Computer hardware, not necessarily the total number of such colors that can be simultaneously displayed in a given text or graphic mode of any machine....
 with 262,144 different possible colors in both 16- and 256- indexed color graphic modes.

Some image editing software allow to apply a gamma correction
Gamma correction

Gamma correction, gamma nonlinearity, gamma encoding, or often simply gamma, is the name of a nonlinear operation used to code and decode luminance or tristimulus values in video or still image systems....
 over the colors of the palette for indexed color image files. In general for files, to apply a gamma correction directly to the color map is a bad practice, due to the original RGB color values are lost. Always it is better to apply the gamma correction through the display hardware (the most of modern display adapters support this feature), or as an active intermediate step of the rendering software through some kind of color management
Color management

In digital imaging systems, color management is the controlled conversion between the color representations of various devices, such as s, digital cameras, monitors, TV screens, film printers, computer printers, offset presses, and corresponding media....
, which preserves the original color values. Only when the indexed color images are intended to systems that lacks any kind of color calibration
Color calibration

The aim of color calibration is to measure or adjust the color response of a device to establish a known relationship to a standard color space....
 abilities and they are not intended to be cross-platform interchanged, the gamma correction may be applied over the color table in 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.


Acronym Full name Creator DOS extension 1-bit (2) 2-bit (4) 3-bit (8) 4-bit (16) 5-bit (32) 6-bit (64) 7-bit (128) 8-bit (256) Compression
PCX
PCX

PCX is an graphics file formats developed by the ZSoft Corporation of Marietta, Georgia, USA. It was the native file format for PC Paintbrush and became one of the first widely accepted MS-DOS imaging standards, although its use has since been succeeded by more sophisticated image formats such as Graphics Interchange Format, JPEG, and Portab...
 
Paintbrush Image File ZSoft Corporation
ZSoft Corporation

ZSoft Corporation was a software company in the 1980s. Zsoft was based in Marietta, Georgia. Zsoft was famous for its development of the PCX graphic file format and the PC Paintbrush software that could edit these files....
.pcx RLE
Run-length encoding

Run-length encoding is a very simple form of data compression in which runs of data are stored as a single data value and count, rather than as the original run....
ILBM
ILBM

ILBM is a subtype of the Interchange File Format used for storing picture data. ILBM stands for InterLeaved BitMap which refers to the way the pictures are stored....
 
InterLeaved BitMap Electronic Arts
Electronic Arts

Electronic Arts is an international video game developer, marketer, video game publisher and distributor of video games. Established in 1982 by Trip Hawkins, the company was a pioneer of the early home computer games industry and was notable for promoting the designers and programmers responsible for its games....
.lbm, .iff Uncompressed, RLE
Run-length encoding

Run-length encoding is a very simple form of data compression in which runs of data are stored as a single data value and count, rather than as the original run....
GIF Graphics Interchange Format Compuserve
CompuServe

CompuServe, , was the first major commercial online service in the United States. It dominated the field during the 1980s and remained a major player through the mid-1990s, when it was sidelined by the rise of information services such as AOL that charged monthly subscriptions rather than hourly rates....
.gif LZW
LZW

Lempel-Ziv-Welch is a universal lossless data compression algorithm created by Abraham Lempel, Jacob Ziv, and Terry Welch. It was published by Welch in 1984 as an improved implementation of the LZ77 and LZ78 algorithm published by Lempel and Ziv in 1978....
TGA
Truevision TGA

Truevision's TGA File Format, often referred to as TARGA File Format, is a raster graphics Graphics file format summary. It was the native format of Truevision's TARGA and VISTA boards, which were the first Graphics processing units for IBM PC compatible to support Highcolor/truecolor display....
 
TARGA File format Truevision
Truevision

Truevision, Inc. was a maker of digital video processing add-on boards for PC computers. It was founded by Cathleen Asch, Carl Calabria, Jospeh Haaf, Bryan Hunt, Brad Pillow, Joe Shepard and Jeff Walters and others when AT&T split off their AT&T EPICenter in 1987....
.tga.vda, .icb.vst RLE
Run-length encoding

Run-length encoding is a very simple form of data compression in which runs of data are stored as a single data value and count, rather than as the original run....
TIFF
Tagged Image File Format

Tagged Image File Format is a file format for storing raster graphics, including photographs and line art. It is now under the control of Adobe Systems....
 
Tagged Image File Format Aldus
Aldus

Aldus Corporation, named after the 15th-century Venice printer Aldus Manutius, was the inventor of the groundbreaking Adobe PageMaker software, a program that is generally credited with creating the desktop publishing field....
.tif Uncompressed, PackBits
PackBits

PackBits is a fast, simple Lossless data compression scheme for run-length encoding of data.Apple Inc. introduced the PackBits format with the release of MacPaint on the Apple Macintosh computer....
, LZW
LZW

Lempel-Ziv-Welch is a universal lossless data compression algorithm created by Abraham Lempel, Jacob Ziv, and Terry Welch. It was published by Welch in 1984 as an improved implementation of the LZ77 and LZ78 algorithm published by Lempel and Ziv in 1978....
 (**)
BMP Device-independent Bitmap Microsoft
Microsoft

Microsoft Corporation is a multinational corporation computer technology corporation that develops, manufactures, licenses, and supports a wide range of computer software products for computing devices....
.bmp, .dib, .rle Uncompressed, RLE
Run-length encoding

Run-length encoding is a very simple form of data compression in which runs of data are stored as a single data value and count, rather than as the original run....
 (***)
PSD
Adobe Photoshop

Adobe Photoshop, or simply Photoshop, is a Graphics software developed and published by Adobe Systems. It is the current and primary Market dominance for commercial Raster graphics and manipulation, and is the flagship product of Adobe Systems....
 
Photoshop
Adobe Photoshop

Adobe Photoshop, or simply Photoshop, is a Graphics software developed and published by Adobe Systems. It is the current and primary Market dominance for commercial Raster graphics and manipulation, and is the flagship product of Adobe Systems....
 Document
Adobe Systems
Adobe Systems

Adobe Systems Incorporated is an United States computer Computer software company headquartered in San Jose, California, USA. The company has historically focused upon the creation of multimedia and creativity software products, with a more-recent foray into rich Internet application software development....
.psd PackBits
PackBits

PackBits is a fast, simple Lossless data compression scheme for run-length encoding of data.Apple Inc. introduced the PackBits format with the release of MacPaint on the Apple Macintosh computer....
PNG Portable Network Graphics PNG Development Group .png DEFLATE
DEFLATE

Deflate is a lossless data compression algorithm that uses a combination of the LZ77 and LZ78 algorithm and Huffman coding. It was originally defined by Phil Katz for version 2 of his PKZIP archiving tool, and was later specified in RFC 1951....


* 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.


See also

  • Palette (computing)
    Palette (computing)

    In computer graphics, a palette is either a given, finite set of colors for the management of digital images , or a small on-screen graphical element for choosing from a limited set of choices, not necessarily colors ....
  • Color depth
    Color depth

    Color depth or bit depth, is a computer graphics term describing the number of bits used to represent the color of a single pixel in a Raster graphicsped image or video frame buffer....
  • Color Look-Up Table
    CLUT

    A colour look-up table is a mechanism used to transform a range of input colors into another range of colors. It can be a hardware device built into an imaging system or a software function built into an application....
  • List of palettes
    List of palettes

    This article is a list of the palette s for notable computer graphics, terminals and video game consoles hardware.Only a sample and the palette's name are given here....
  • Image file formats
    Image file formats

    Image file formats are standardized means of organizing and storing images. This entry is about digital image formats used to store photographic and other images; ....
  • Computer display
    Computer display

    A visual display unit, often called simply a monitor or display, is a piece of electrical equipment which displays images generated from the video output of devices such as computers, without producing a permanent record....
  • List of home computers by video hardware
    List of home computers by video hardware

    This is a list of home computers, sorted alphanumerically, which lists all relevant details of their Video Display Controller.A home computer was the description of the second generation of desktop computers, entering the market in 1977 and becoming common during the 1980s....


External links