Palette (computing)
Encyclopedia
In computer graphics
Computer graphics
Computer graphics are graphics created using computers and, more generally, the representation and manipulation of image data by a computer with help from specialized software and hardware....

, a palette is either a given, finite set of color
Color
Color or colour is the visual perceptual property corresponding in humans to the categories called red, green, blue and others. Color derives from the spectrum of light interacting in the eye with the spectral sensitivities of the light receptors...

s for the management of digital image
Digital image
A digital image is a numeric representation of a two-dimensional image. Depending on whether or not the image resolution is fixed, it may be of vector or raster type...

s (that is, a color palette), or a small on-screen graphical element for choosing from a limited set of choices, not necessarily colors (such as a tools palette).

Depending on the context (an engineer's technical specification, an advertisement, a programmers' guide, an image file specification, a user's manual, etc.) the term palette and related terms such as Web palette and RGB palette, for example, can have somewhat different meanings.

Color palettes

The following are some of the widely used meanings for color palette in computing:
  • The total number of colors that a given system is able to generate or manage (though, due to video memory
    Video memory
    Video memory is a term generally used in computers to describe some form of writable memory, usually RAM, dedicated to the purpose of holding the information necessary for a graphics card to drive a display device...

     limitations, it may not be able to display them all simultaneously):
    • full palette: For example, Highcolor displays are said to have a 16-bit RGB palette.
  • The limited selection of colors that can be displayed simultaneously:
    • On the whole screen:
      • fixed palette selection: A given display adapter can offer a fixed color selection when its 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.The hardware registers inside a central processing unit are called processor registers....

        s are appropriately set. For example, 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 IBM's first color graphics card, and the first color computer display standard for the IBM PC....

         (CGA), in one of the standard graphics modes, can be set to show the so-called palette #1 or the palette #2: two combinations of 3 fixed colors and one user-defined background color each.
      • selected colors or picked colors: In this case, the color selection, generally from a wider explicitly available full palette, is always chosen by software, both by the user or by a program. For example, the standard VGA
        Video Graphics Array
        Video Graphics Array refers specifically to the display hardware first introduced with the IBM PS/2 line of computers in 1987, but through its widespread adoption has also come to mean either an analog computer display standard, the 15-pin D-subminiature VGA connector or the 640×480 resolution...

         display adapter is said to provide a palette of 256 simultaneous colors from a total of 262,144 different colors.
      • default palette or system palette: The given selected colors have been officially standardized by some body or corporation. For example, the well known Web-safe colors for use with Internet browser
        Web browser
        A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...

        s, or the Microsoft Windows
        Microsoft Windows
        Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

         default palette.
    • On an individual image:
      • color map or color table: The limited color selection is stored inside the given indexed color
        Indexed color
        In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer memory and file storage, while speeding up display refresh and file transfers...

         image file. For example, GIF.
      • image palette or image colors: The limited color selection is assumed to be the full list of the colors the given digital image
        Digital image
        A digital image is a numeric representation of a two-dimensional image. Depending on whether or not the image resolution is fixed, it may be of vector or raster type...

         has, even when the image file does not employ indexed color
        Indexed color
        In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer memory and file storage, while speeding up display refresh and file transfers...

         pixel
        Pixel
        In digital imaging, a pixel, or pel, is a single point in a raster image, or the smallest addressable screen element in a display device; it is the smallest unit of picture that can be represented or controlled....

         encoding.
  • The underlying hardware that may be used to hold those simultaneous colors:
    • hardware palette or Color Look-Up Table
      CLUT
      A colour look-up table is a mechanism used to transform a range of input colours into another range of colours. It can be a hardware device built into an imaging system or a software function built into an image processing application...

      (CLUT): In order to show them, the selected colors' values must be loaded in the 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.The hardware registers inside a central processing unit are called processor registers....

      s of the display subsystem. For example, the hardware registers of the Commodore Amiga
      Amiga
      The Amiga is a family of personal computers that was sold by Commodore in the 1980s and 1990s. The first model was launched in 1985 as a high-end home computer and became popular for its graphical, audio and multi-tasking abilities...

       are known both as their color palette and their CLUT, depending on sources.

GUI palettes

Graphical user interface
Graphical user interface
In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...

 (GUI) systems use on-screen palettes, including:
  • An arrangement of a limited set of user or system colors that can be chosen. In such cases, the expression color palette or user color palette are common equivalents. This usage resembles a true artist's palette
    Palette (painting)
    A palette , in the original sense of the word, is a rigid, flat surface on which a painter arranges and mixes paints. A palette is usually made of wood, plastic, ceramic, or other hard, inert, nonporous material, and can vary greatly in size and shape...

    .
  • A tool palette, a rectangular area, called a palette window, of the application screen with button
    Button (computing)
    In computing, a button is a user interface element that provides the user a simple way to trigger an event, like searching for a query at a search engine, or to interact with dialog boxes, like confirming an action.-Description:A typical button is a rectangle or rounded rectangle, wider than it is...

    s, icon
    Icon (computing)
    A computer icon is a pictogram displayed on a computer screen and used to navigate a computer system or mobile device. The icon itself is a small picture or symbol serving as a quick, intuitive representation of a software tool, function or a data file accessible on the system. It functions as an...

    s or another GUI
    Graphical user interface
    In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...

     controls available for quick command or symbol access; if the user is able to place it anywhere by moving it through a mouse
    Mouse (computing)
    In computing, a mouse is a pointing device that functions by detecting two-dimensional motion relative to its supporting surface. Physically, a mouse consists of an object held under one of the user's hands, with one or more buttons...

     or similar pointing device, it is known as a floating palette. A palette for choosing colors can be also a floating palette.

Related terms and technologies

See also Indexed color
Indexed color
In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer memory and file storage, while speeding up display refresh and file transfers...



The terms color palette, indexed color, and related terms have been used with various differences in meaning, as discussed below.

The RGB color model
RGB color model
The RGB color model is an additive color model in which red, green, and blue light is added together in various ways to reproduce a broad array of colors...

 is today the most usual method to produce and encode colors; but colors in palettes may or may not be reproduced through red-green-blue primaries, depending on a given display hardware. To express that a given palette usage is based in the RGB color model, the term RGB palette is commonly employed, within many of the contexts in which the term palette can be used (see the previous section). The RGB color model is usually assumed by default for palettes, if not otherwise noted.

Indexed color
Indexed color
In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer memory and file storage, while speeding up display refresh and file transfers...

 is a technique to manage image colors in a limited fashion, in order to save RAM and video memory buffer space, file storage space, telecom bandwidth
Bandwidth (computing)
In computer networking and computer science, bandwidth, network bandwidth, data bandwidth, or digital bandwidth is a measure of available or consumed data communication resources expressed in bits/second or multiples of it .Note that in textbooks on wireless communications, modem data transmission,...

, and to speed up display refresh and telecom transfers. Instead of storing and managing every primary color component of every pixel
Pixel
In digital imaging, a pixel, or pel, is a single point in a raster image, or the smallest addressable screen element in a display device; it is the smallest unit of picture that can be represented or controlled....

, the most representative colors, or the fixed hardware colors, are grouped into a limited size palette: an array of color elements, in which each element (a color) is indexed by its position. This way, the pixels contain not the full color components but merely their index into the palette; this is sometimes referred as pseudocolor.

This technique saves a lot of memory/storage space and/or transmission time: if the full RGB color palette is truecolor, there are 16,777,216 different possible colors, and each pixel needs 24 bits, or 3 byte
Byte
The byte is a unit of digital information in computing and telecommunications that most commonly consists of eight bits. Historically, a byte was the number of bits used to encode a single character of text in a computer and for this reason it is the basic addressable element in many computer...

s. A typical 640×480 VGA resolution, truecolor uncompressed image needs (900 KiB). Limiting the image colors to 256, every pixel needs only 8 bits, 1 byte, so the example image now needs only (300 KiB), plus to store the palette map (assuming 24-bit 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 1/6 or 1/12), obviously at cost of color accuracy. While it is acceptable for little images (icons
Icon (computing)
A computer icon is a pictogram displayed on a computer screen and used to navigate a computer system or mobile device. The icon itself is a small picture or symbol serving as a quick, intuitive representation of a software tool, function or a data file accessible on the system. It functions as an...

) or very simple graphics, to reproduce real-life images this loss of color availability becomes more of a problem. 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. Computer algorithms to perform color...

, anti-aliasing
Anti-aliasing
In digital signal processing, spatial anti-aliasing is the technique of minimizing the distortion artifacts known as aliasing when representing a high-resolution image at a lower resolution...

, and dithering combined together can approximate indexed 256-color images to the original one.

A palette entry is one of the color items in a color palette (in hardware or in a file).

Indexed color has been widely used in early personal computer
Personal computer
A personal computer is any general-purpose computer whose size, capabilities, and original sales price 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. Notable computer graphics systems extensively (or even exclusively) using pseudocolor palettes include EGA
Enhanced Graphics Adapter
The Enhanced Graphics Adapter is the IBM PC computer display standard specification which is between CGA and VGA in terms of color and space resolution. Introduced in October 1984 by IBM shortly after its new PC/AT, EGA produces a display of 16 simultaneous colors from a palette of 64 at a...

 and VGA (for the IBM PC compatible
IBM PC compatible
IBM PC compatible computers are those generally similar to the original IBM PC, XT, and AT. Such computers used to be referred to as PC clones, or IBM clones since they almost exactly duplicated all the significant features of the PC architecture, facilitated by various manufacturers' ability to...

s), the Atari ST
Atari ST
The Atari ST is a home/personal computer that was released by Atari Corporation in 1985 and commercially available from that summer into the early 1990s. The "ST" officially stands for "Sixteen/Thirty-two", which referred to the Motorola 68000's 16-bit external bus and 32-bit internals...

 and Amiga
Amiga
The Amiga is a family of personal computers that was sold by Commodore in the 1980s and 1990s. The first model was launched in 1985 as a high-end home computer and became popular for its graphical, audio and multi-tasking abilities...

's OCS
Original Amiga chipset
The Original Chip Set was a chipset used in the earliest Commodore 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....

.

The same way, image file formats used to encapsulate this kind of images, as PCX
PCX
PCX is an image file format developed by the now-defunct ZSoft Corporation of Marietta, Georgia. It was the native file format for PC Paintbrush and became one of the first widely accepted DOS imaging standards, although it has since been succeeded by more sophisticated image formats, such as GIF,...

 and GIF, which along with a header and the raw image data store the palette color maps as well, arose in the same period (circa the 1980s). Some of the more modern image file formats as BMP, TIFF and PNG also allow indexed color modes, generally up to 16 or 256 (four or eight bits per pixel). All these file formats commonly supports some compression
Image compression
The objective of image compression is to reduce irrelevance and redundancy of the image data in order to be able to store or transmit data in an efficient form.- Lossy and lossless compression :...

 scheme, enhancing their ability to store the indexed color images at smaller file sizes.

A Color Look-up Table (CLUT) is a hardware resource of the display subsystem, which can be used for different purposes. One is to contain the color values for a given palette in some indexed color graphic mode (lets say, 320×200 with 256 colors, often used for computer videogames). Today, CLUTs are used mainly to perform gamma
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...

 and color temperature
Color temperature
Color temperature is a characteristic of visible light that has important applications in lighting, photography, videography, publishing, manufacturing, astrophysics, and other fields. The color temperature of a light source is the temperature of an ideal black-body radiator that radiates light of...

 calibrations by hardware. Although the term color look-up table was coined in display hardware design field (as the machines always come first), it has been ported to the software jargon as a near synonym of palette too; but in these cases, it can mean not only the color map of an indexed color image but also any intermediary look-up table which maps one colors into another, regardless of indexed or truecolor is used. In order to avoid confusion, the term CLUT is preferred for the color hardware registers and palette for the software color maps when both are employed in the same paper.

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 usually do not need palettes. The pixel values can be directly the gray level in a given range (0 to 15, 0 to 255), so image files that deal with grayscale images usually do not store a palette color map for this purpose. But when displayed with color devices, generally it is necessary to synthesize a grayscale color map to manage the image properly (either by loading the color hardware registers/CLUT, or by converting the image to RGB in an RGB video memory). Some image file formats, such as BMP file format implement grayscale by storing a grayscale palette made with full RGB values.

Color depth
Color depth
In computer graphics, color depth or bit depth is the number of bits used to represent the color of a single pixel in a bitmapped image or video frame buffer. This concept is also known as bits per pixel , particularly when specified along with the number of bits used...

 denotes how many bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...

s are employed to store color information in the image pixels: the more the colors managed, the more the bits employed. The pixel's bit patterns can be interpreted as whole integer numbers (which is the case for indexed color images' indices) or by assigning some bits for color related management, as relative intensities for every primary red-green-blue in RGB truecolor images. Indexed color palette sizes often have up to 2 raised to some power entries, which easily match pixel's depth bit patterns: , or are the most common choices. Highcolor uses RGB full palettes either 15-bits and 16-bits depth, while truecolor uses RGB full palettes of 24-bits depth or greater.

Adaptive versus master palettes

When using indexed color
Indexed color
In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer memory and file storage, while speeding up display refresh and file transfers...

 techniques, real life images are represented with better fidelity to the truecolor original one by using adaptive palettes (sometimes spelled adaptative palettes), in which the colors are selected or quantized
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. Computer algorithms to perform color...

 through some algorithm directly from the original image (by picking the most frequent colors). This way, and with further dithering, the indexed color image can nearly match the original.

But this creates a heavy dependence between the image pixel
Pixel
In digital imaging, a pixel, or pel, is a single point in a raster image, or the smallest addressable screen element in a display device; it is the smallest unit of picture that can be represented or controlled....

s and its adaptive palette. Assuming a limited 8-bit depth graphic display, it is necessary to load a given image's adaptive palette into the color hardware registers previously to the load of the image surface in itself into the video frame buffer
Framebuffer
A framebuffer is a video output device that drives a video display from a memory buffer containing a complete frame of data.The information in the memory buffer typically consists of color values for every pixel on the screen...

. So to see on the screen different images with different adaptive palettes, they must to be loaded one by one, as in a slideshow
Slideshow
A slide show is a display of a series of chosen information or pictures, done for artistic or instructional purposes. Slide shows are conducted by a presenter using an apparatus, such as a carousel slide projector, an overhead projector or in more recent years, a computer running presentation...

. This way, all works fine. Here are samples of four different indexed color images with color patches to show their respective (and largely incompatible) adaptive palettes:


An application can, in turn, show many different image 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 in a mosaic on screen. It is obvious that the program cannot load all the adaptive palettes of every displayed image thumbnail at the same time in the hardware color registers. A solution is to use a unique, common master palette or universal palette, which can be used to display with reasonable accuracy any kind of image.

This is done by selecting colors in such way that the master palette comprises a full RGB color space
RGB color space
An RGB color space is any additive color space based on the RGB color model. A particular RGB color space is defined by the three chromaticities of the red, green, and blue additive primaries, and can produce any chromaticity that is the triangle defined by those primary colors...

 "in miniature", limiting the possible levels that the red, green and blue components may have. This kind of arrangement is sometimes referred as a uniform palette. The normal human eye
Human eye
The human eye is an organ which reacts to light for several purposes. As a conscious sense organ, the eye allows vision. Rod and cone cells in the retina allow conscious light perception and vision including color differentiation and the perception of depth...

 has sensibility to the three primary colors in different degrees: the more to the green, the less to the blue. So RGB arrangements can take advantage of this by assigning more levels for the green component and less to the blue.

A master palette built this way can be filled with up to , but this does not leave space in the palette for reserved colors, color indices that the program could use for special purposes. It is more general to use only (as in the Web colors
Web colors
Web colors are colors used in designing web pages, and the methods for describing and specifying those colors. Hexadecimal color codes begin with a hash ....

 case), or , which leave room for some reserved colors.

Then, when loading the mosaic of image thumbnails (or other heterogeneous images), the program simply maps every original indexed color pixel to its most approximated in the master palette (after dumping this into the hardware color registers), and writes the result in the video buffer. Here is a sample of a simple mosaic of the four image thumbnails using a master palette of 240 RGB arranged colors plus 16 additional intermediate shades of gray; all images are put together without a significant loss of color accuracy:

Transparent color in palettes

See also Transparency (graphic)
Transparency (graphic)
Transparency is possible in a number of graphics file formats. The term transparency is used in various ways by different people, but at its simplest there is "full transparency" i.e. something that is completely invisible. Of course, only part of a graphic should be fully transparent, or there...



A single palette entry in an indexed color
Indexed color
In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer memory and file storage, while speeding up display refresh and file transfers...

 image can be designated as a transparent color, in order to perform a simple video overlay: superimposing a given image over a background in such way that some part of the overlapped image obscures the background and the remaining not. Superimposing film/TV titles and credits is a typical application of video overlay.

In the image to be superimposed (indexed color is assumed), a given palette entry plays the role of the transparent color. Usually the index number 0, but other may be chosen if the overlay is performed by software. At design time, the transparent color palette entry is assigned to an arbitrary (usually distinctive) color. In the example below, a typical arrow cursor
Cursor (computers)
In computing, a cursor is an indicator used to show the position on a computer monitor or other display device that will respond to input from a text input or pointing device. The flashing text cursor may be referred to as a caret in some cases...

 for a pointing device
Pointing device
A pointing device is an input interface that allows a user to input spatial data to a computer...

 is designed over an orange background, so here the orange areas denoted the transparent areas (left). At run time, the overlapped image is placed anywhere over the background image, and it is blended in such way that if the pixel color index is the transparent color, the background pixel is kept, otherwise it is replaced. The result is an image with irregular shapes perfectly placed over the background (right).
{| style="border-style:none" border="0" cellpadding="16"

|-
|
| NOTE: this is merely an example. No actual use in a given operating system must be inferred.
|}

This technique is used for pointing devices' cursors, in typical 2-D videogames for characters, bullets and so on (the sprite
Sprite (computer graphics)
In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene...

s), video titling and other image mixing applications.

Some early computers, as Commodore 64
Commodore 64
The Commodore 64 is an 8-bit home computer introduced by Commodore International in January 1982.Volume production started in the spring of 1982, with machines being released on to the market in August at a price of US$595...

, MSX
MSX
MSX was the name of a standardized home computer architecture in the 1980s conceived by Kazuhiko Nishi, then Vice-president at Microsoft Japan and Director at ASCII Corporation...

 and Amiga
Amiga
The Amiga is a family of personal computers that was sold by Commodore in the 1980s and 1990s. The first model was launched in 1985 as a high-end home computer and became popular for its graphical, audio and multi-tasking abilities...

 supports sprites and/or full screen video overlay
Genlock
Genlock is a common technique where the video output of one source, or a specific reference signal from a signal generator, is used to synchronize other television picture sources together. The aim in video and digital audio applications is to ensure the coincidence of signals in time at a...

 by hardware. In these cases, the transparent palette entry number is defined by the hardware, and it used to be the number 0.

Some indexed color image file format
Comparison of graphics file formats
-General:Ownership of the format and related information.-Technical details:...

s as GIF and PNG natively supports the designation of a given palette entry as transparent, freely selectable among any of the palette entries used for a given image.

The BMP file format reserves space for Alpha channel values in its Color Table, however currently this space is not being used to hold any translucency data and is set to zero.

When dealing with truecolor images, some video mixing equipment can employ the RGB triplet (0,0,0) (no red, no green, no blue: the darkest shade of black, sometimes referred as superblack in this context) as the transparent color. At design time, it is replaced by the so-called magic pink. The same way, typical desktop publishing
Desktop publishing
Desktop publishing is the creation of documents using page layout software on a personal computer.The term has been used for publishing at all levels, from small-circulation documents such as local newsletters to books, magazines and newspapers...

 software can assume pure white, RGB triplet (255,255,255) from photos and illustrations to be excluded in order to let the text paragraphs to invade the image's bounding box
Minimum bounding box
The minimum or smallest bounding or enclosing box for a point set in N dimensions is the box with the smallest measure within which all the points lie...

 for irregular text arrangement around the image's subjects.

2-D painting program
2D computer graphics
2D computer graphics is the computer-based generation of digital images—mostly from two-dimensional models and by techniques specific to them...

s, like Microsoft Paint and Deluxe Paint
Deluxe Paint
Deluxe Paint is a bitmap graphics editor series originally created by Dan Silva for Electronic Arts .The original version was created for the Commodore Amiga and was released in November 1985...

, can employ the user designated background color as the transparent color when performing cut, copy, and paste operations.

Although related (due to they are used for the same purposes), image bit masks and alpha channels are techniques which not involve the use of palettes nor transparent color at all, but off-image added extra binary data layers.

System and logical palettes under Microsoft Windows

Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 applications manage the palette of 4-bit or 8-bit indexed color display devices through specialized functions of the Win32 API (for Highcolor and Truecolor display modes, such functions lacks any interesting functionality). These APIs deals with the so-called system palette and with many logical palettes.

The system palette is a copy in RAM
Ram
-Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

 of the color display's hardware registers, primarily a physical palette, and it is a unique, shared common resource of the system. At boot, it is loaded with the default system palette (mainly a master palette which works well enough with most programs).

When a given application intends to output colorized graphics and/or images, it can set their own logical palette, that is, its own private selection of colors (up to 256). It is supposed that every graphic element that the application tries to show on screen employs the colors of its logical palette. Every program can manage freely one or more logical palettes without further expected interference (in advance).

Before the output is effectively made, the program must to realize its logical palette: the system tries to match then the logical colors with physical ones. If an intended color is already present into the system palette, the system internally maps both the logical and the system palette indexes (due to they rarely coincide). If the intended color is not present yet, the system applies an internal algorithm to discard the least used color in the system palette (generally, some used by another window in the background) and substitutes it with the new color. Due to there are limited room for colors in the system palette, the algorithm tries also to remap similar colors together, and always by avoiding redundant colors.

The final result depends on how many applications are working with on screen colors. The foreground window is always favoured, so windows at background may behave in different ways: from become corrupted to quickly redraw themselves. When the system palette changes, the system triggers a specific event
Event-driven programming
In computer programming, event-driven programming or event-based programming is a programming paradigm in which the flow of the program is determined by events—i.e., sensor outputs or user actions or messages from other programs or threads.Event-driven programming can also be defined as an...

 to inform every application. When received, a window can quickly redraw itself using a single Win32 API function. But this must be doing explicitly in the program code; hence the fact that many programs lack in manage this event, and their windows become corrupt in this situation.

An application can force the system palette to be loaded with specific colors and even in a specific order, tricking the system by telling they are color entries intended for animation (quick color changes of the colors in the physical palette at specific entries). The system cannot assume then that every hardware palette entry is free for their palette color managements, and those entries are excluded from its algorithm. The final result depend on the skills of the color forcing program and the behaviour of the other programs (the lasts exactly as in the regular case), and that of the operating system in itself.

See also

  • Indexed color
    Indexed color
    In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer memory and file storage, while speeding up display refresh and file transfers...

  • Color depth
    Color depth
    In computer graphics, color depth or bit depth is the number of bits used to represent the color of a single pixel in a bitmapped image or video frame buffer. This concept is also known as bits per pixel , particularly when specified along with the number of bits used...

  • Color Look-Up Table
    CLUT
    A colour look-up table is a mechanism used to transform a range of input colours into another range of colours. It can be a hardware device built into an imaging system or a software function built into an image processing application...

  • List of palettes
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK