Computer representation of color

Color representations

In order to be able to handle colors correctly and to exchange colorimetric information it is necessary to have the means to categorize them and to choose them. Thus, it is not uncommon to have the choice of the color of a product before it is even manufactured. In this case, a palette is presented, in which the appropriate color is selected. Most of the time, the product (vehicle, building, etc) has a color which corresponds to that selected.

Likewise in IT, it is essential to have a means of choosing a color among all those that are usable. However, the possible color range is very vast and the image processing chain passes through various peripheral devices: for example, a digitizer (scanner) followed by image improvement software, and finally a printer. It is thus necessary to be able to represent the color in a reliable way in order to ensure coherence between these various peripheral devices.

The mathematical representation of a set of colors is thus called the "color space". There are several, among which the best known are:

  • RGB Coding (Red, Green, Blue).
  • HSL Coding (Hue, Saturation, Luminance).
  • CMYK Coding.
  • CIE Coding.
  • YUV Coding.
  • YIQ Coding.

The color spectrum that a peripheral display device allows to be shown is called a gamut or colorimetric space. The colors not belonging to the gamut are called out-of-range colors.

Selection of colors in software

Most graphic software offers means of selecting a color in an interactive way. The main one is often the swatch chart, that is, the colors are presented in a table in which they are classified by nuances:

Swatch chart

More and more software is integrating more powerful tools however, allowing the choice of a color from a vast range. Thus, in the color selector below, the hue is represented by a chromatic disc, while luminance is represented by a vertical selector offering the color nuances ranging from black to white.

Color selector

In the selector below on the other hand, the hue is presented as an X-coordinate of the selector on the left, and the saturation is presented as a Y-coordinate. The selector on the right-hand side makes it possible to regulate the luminosity:

Color selector

Gamma factor

The criterion that defines the nonlinear character of the luminous intensity of an element is called the facteur gamma.

Thus, the luminance of a computerscreen is nonlinear insofar as :

  • the luminous intensity which it emits is not linearly proportional to the voltage applied, but corresponds to a function curve of the screen gamma (usually between 2.3 and 2.6):

I ~ Vgamma
  • the luminous intensity perceived by the eye is not proportional to the quantity of light actually emitted

In order to overcome this and to obtain a satisfactory reproduction of the luminous intensity, it is possible to compensate for luminance by applying a transformation called a "gamma correction".

Gamma correction

Thus, there is a gamma transformation corresponding to each peripheral display device, which is itself capable of being adapted to the perception of the user.

Color management

It is easy to understand the interest regarding image colors when passing through several peripheral devices (a digital chain made up for example of a scanner, an image processing software and then a printer) in order to make sure that the image at the end of the processing chain has colors close to those of the original image. The group of operations that are necessary to guarantee the good conservation of the colors of an image is known as "color management".

In order to be able to guarantee color coherence, it is essential to calibrate (or gauge) all the devices or tools of the digital chain. The calibration (or gauging) of a device or tool thus consists in describing all the colors which it is capable of acquiring or producing (i.e. its gamut) in an independent color space (for example CIE Lab or CIE XYZ) in a file called an ICC profile (International Color Consortium).

This ICC profile is integrated in the image and conveys the entire set of transformations which it underwent along the image processing chain, as a follow-up log.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Computer representation of color », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (