ArticleslgStudy

computer science

Indexed color

Indexed color is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Indexed color rather than just read about it. In short: In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer storage, while speeding up display refresh and file transfers. It is a form of vector quantization compression.

Indexed color — main illustration
Indexed color — illustration

Key takeaways

  • Indexed color belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Indexed color to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Indexed color from memory before moving on to harder problems.

Reference excerpt

In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer storage, while speeding up display refresh and file transfers. It is a form of vector quantization compression. When an image is encoded in this way, color information is not directly carried by the image pixel data, but is stored in a separate piece of data called a color lookup table (CLUT) or palette: an array of color specifications. Every element in the array represents a color, indexed by its position within the array. For color information, each image pixel then specifies only its index into the palette. This technique is sometimes referred as pseudocolor or indirect color, as colors are addressed indirectly.

History Early graphics display systems that used 8-bit indexed color with frame buffers and CLUTs include Shoup's SuperPaint (1973) and the video frame buffer described in 1975 by Kajiya, Sutherland, and Cheadle. These supported a palette of 256 RGB colors. SuperPaint used a shift-register frame buffer, while the Kajiya et al. system used a random-access frame buffer. A few earlier systems used 3-bit color, but typically treated the bits as independent red, green, and blue on/off bits rather than jointly as an index into a CLUT.

Palette size

The palette itself stores a limited number of distinct colors; 4, 16 or 256 are the most common cases. These limits are often imposed by the target architecture's display adapter hardware, so it is not a coincidence that those numbers are exact powers of two: 22 = 4, 24 = 16 and 28 = 256. While 256 values can fit into a single 8-bit byte (and then a single indexed color pixel also occupies a single byte), multiple pixel indices with 16 (4-bit, a nibble) or fewer colors can be packed together into a single byte (two nibbles per byte, if 16 colors are employed, or four 2-bit pixels per byte if using 4 colors). Sometimes, 1-bit (2-color) values can be used, and then up to eight pixels can be packed into a single byte; such images are considered binary images (sometimes referred as a bitmap or bilevel image) and not an indexed color image. If simple video overlay is intended through a transparent color, one palette entry is specifically reserved for this purpose, and it is discounted as an available color. Some machines, such as the MSX series, had the transparent color reserved by hardware. Indexed color images with palette sizes beyond 256 entries are rare. The practical limit is around 12 bits per pixel, 4,096 different indices. Useful direct RGB high color modes can be used from 15 bpp and up. If an image has many subtle color shades, it is necessary to select a limited repertoire of colors to approximate the image using color quantization. Such a palette is frequently insufficient to represent the image accurately; difficult-to-reproduce features such as gradients will appear blocky or as strips (color banding). In those cases, it is usual to employ dithering, which mixes different-colored pixels in patterns, exploiting the tendency of human vision to blur nearby pixels together, giving a result visually closer to the original one. Here is a typical indexed 256-color image and its own palette (shown as a rectangle of swatches):

Colors and palettes

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

Early color techniques Many early personal and home computers had very limited hardware palettes that could produce a very small set of colors. In these cases, each pixel's value is mapped directly onto one of these colors. Well-known examples include the Apple II, Commodore 64 and IBM PC CGA, all of which include hardware that can produce a fixed set of 16 colors. In these cases, an image can encode each pixel with 4 bits, directly selecting the color to use. In most cases, however, the display hardware supports additional modes where only a subset of those colors can be used in a single image, a useful technique to save memory. For instance, the CGA's 320 × 200 resolution mode can show only four of the 16 colors at one time. As the palettes are entirely proprietary, an image generated on one platform cannot be directly viewed properly on another. Other machines of this era had the ability to generate a larger set of colors, but generally only allowed a subset of those to be used in any one image. Examples include the 256-color palette on Atari 8-bit computers with their GITA chip or the 64 colors of the VT241 terminal in ReGIS graphics mode. In these cases, a small subset of the total number of colors could be displayed at one time, four, for example, on the VT241. Architecturally, these systems worked similarly to their less colorful brethren, but a key difference was that there were too many colors in the palette to directly encode in the pixel data, given the limited amount of video memory. Instead, they used a color look-up table (CLUT) where each pixel's data pointed to an entry in the CLUT, and the CLUT was set up under program control. This meant that the image CLUT data had to be stored along with the raw image data in order to be able to reproduce the image correctly.

… excerpt ends here. Continue reading the full article.

Illustrations

Indexed color illustration
Indexed color illustration
Indexed color illustration
Indexed color illustration
Indexed color illustration

Worked examples

Example 1 — a first encounter with Indexed color

Start with the simplest possible case. Write down what Indexed color claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Indexed color before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Indexed color ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Indexed color

In research
Indexed color appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Indexed color in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Indexed color is common in secondary-school and first-year university syllabi. It links to neighbouring topics Color, Computer graphics data structures, Computer output devices, so understanding it makes those chapters shorter.
In everyday life
Look for Indexed color outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Indexed color” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Indexed color in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Indexed color means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Indexed color out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Indexed color in simple terms?

In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer storage, while speeding up display refresh and file transfers. It is a form of vector quantization compression.

Why does Indexed color matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Indexed color?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Indexed color.

Tags

  • Color
  • Computer graphics data structures
  • Computer output devices

Keep exploring