color spaces (original) (raw)

Author: the photonics expert (RP)

Definition: mathematical spaces for representing color values

Alternative terms: color model, color system

Category: article belongs to category vision, displays and imaging vision, displays and imaging

Related: color visioncolorimetrychromaticityRGB sources

Page views in 12 months: 3515

DOI: 10.61835/v62 Cite the article: BibTex BibLaTex plain textHTML Link to this page! LinkedIn

Content quality and neutrality are maintained according to our editorial policy.

Contents

What are Color Spaces?

Colors are essentially an interpretation of the human brain, applied to the limited spectral information received from the eyes. The relation between color perception and its physical basis is quite complicated and subject to various influences. Nevertheless, extensive research has established ways of objectively specifying perceivable colors with values in certain color spaces.

Ideally, one would like to have a system where each color which can be perceived or generated is uniquely identified by a specific value in a color space, creating a perfect bidirectional mapping between the reality of color vision and the constructed color space. Also, it would be desirable that distances in color space are well associated with differences in color perception. Further, the mathematical construction should not be too complicated, and the results should be easy to apply in practice. Unfortunately, however, color spaces can usually not have all desirable properties. For example, some of them cannot span the whole range of perceivable colors, while others contain imaginary colors (in addition to the perceivable colors) which cannot be physically realized. Different types of color spaces have been constructed, often with specific applications in mind. Overall, the development and application of colors spaces is a rather involved subject, over which this encyclopedia article is meant to give a coarse overview.

In most cases, a color space has three dimensions, according to the three different kinds of color receptors used for photopic vision of the human eye, having trichromatic vision. Consequently, a color value can usually be specified with the combination of three color coordinates (tristimulus values). It can be considered as a combination of three primary colors, with each color coordinate specifying the strength of the contribution of one primary color. Some color spaces use primary colors which cannot be physically realized (imaginary colors). The mixing of primary colors is additive in most cases (e.g. in RGB color spaces), but subtractive in some others, e.g. in CMYK color spaces, related to the mixing of pigments or dyes.

In some cases, one takes one dimension of the color space to be the luminance (specifying the perceived brightness), and the remaining dimensions determine the chromaticity. Chromaticity may further be divided into hue (“type of color”) and color saturation. (Maximum color saturation is obtained for spectral colors, corresponding to monochromatic light.) However, not all color spaces realize such divisions; for example, RGB color spaces do not use a luminance channel.

It is also possible to define a color space based on an arbitrary set of reference colors (color swatches), trying to span a wide range of perceivable or at least printable colors, but without arranging those in a multidimensional space. A prominent example is the system of Pantone colors, which is widely used for printing purposes. However, this article focuses on three-dimensional color spaces, as used e.g. for computer monitors, television and photography, with full capabilities of color mixing.

Color spaces are often used within a color management system, made for obtaining the best possible color reproduction. For example, one may acquire color images with photo cameras, producing image files with certain RGB color profiles (often defined more closely with an ICC color profile). One can then process such images in software for generating a PDF file sent to a printing facility, where one may e.g. use a CMYK color space which is better adapted to printing. The color management then must include appropriate transformations between different color spaces, ideally preserving the color information throughout the chain from image acquisition to printing. However, one may also apply color corrections, e.g. for eliminating effects of non-ideal illumination conditions or just to improve the appeal of the images.

Of course, any light would be much more comprehensively characterized by its optical spectrum, which represents (for infinitely fine wavelength or frequency resolution) a space with infinite dimensions. However, if the finally relevant aspect is only the caused color perception of the human eye, it would be neither economical nor practical to work with optical spectra. For example, a color image can be stored with much less memory when considering only the three dimensions in a color space instead of the many dimensions according to the wavelength channels of an optical spectrometer. Also, it can be preferable to have only one possible point in color space corresponding to a certain color impression instead of a wide range of different optical spectra which are compatible with that (metamerism). For example, one can then easily judge which color values are similar. Some technical applications not related to color vision, however, make use of the much more comprehensive spectral information of images with many more wavelength channels (→ hyperspectral imaging), which may also cover more than only the visible part of the spectrum.

In the following, important color spaces are explained. For an introductory explanation of the physiological basis, see the article on color vision.

Important Color Spaces

LMS Color Space

The LMS color space is defined based on three coordinates L, M and S, each one measuring the strength of excitation of one of the three types of cones in the retina of the human eye. Note that it is physically not possible e.g. to have a non-zero M value combined with L and S being zero because the spectral response curves of the three receptors are substantially overlapping. Therefore, the range of perceivable colors corresponds to a volume in LMS color space which is not simply a cuboid.

For monochromatic light, the L, M and S values are defined by the LMS color matching functions of CIE, see Figure 1. These data can of course also be applied to polychromatic light, integrating the contributions of different wavelength components according to some optical spectrum.

LMS color matching functions

Figure 1: LMS color matching functions from CIE, based on the Stiles and Burch 10° color matching functions. Data source: Colour & Vision Research Laboratory of the University College London, page on CIE 2006 physiologically-relevant LMS functions.

LMS values can be directly measured e.g. in a tristimulus colorimeter and are useful e.g. for comparing color values: two different optical spectra having the same LMS coordinates can be expected to create the same color impression, at least for human beings with normal color vision.

LMS color space can represent any perceivable colors. However, it is not particularly suitable for some technical applications. In particular, it is not immediately apparent how to generate light which creates the color impression related to a particular point in LMS color space; we cannot directly address the different receptors in the eye because of their spectral sensitivity curves overlap substantially.

CIE XYZ Color Space and Derived Versions

In 1931, the CIE (Commission Internationale de l'Éclairage = International Commission on Illumination) has defined its XYZ color space, which has become very important; it has become a general reference and the basis for the definition of various other color spaces.

The CIE color model takes the luminance (as measure for perceived brightness) as one of the three color coordinates, calling it Y. The spectral response of the luminance is specified as the photopic luminosity function. The maximum possible Y value, e.g. for a color image, may be chosen to be 1 or 100, for example. The coordinate Z responds mostly to shorter-wavelength light, while X responds both to shorter- and longer-wavelength light. Figure 2 shows the used color matching functions.

CIE XYZ values

Figure 2: The CIE XYZ color matching functions for a 2-degree field. Data source: Colour & Vision Research Laboratory of the University College London, page on CIE XYZ functions.

CIE has also introduced normalized coordinates ($x$), ($y$) and ($z$), obtained by dividing the X, Y and Z values by (X + Y + Z). One can then take ($x$) and ($y$) as chromaticity coordinates, determining color tones for a certain luminance. That system is called CIE xyY because a color value is defined by the chromaticity coordinates ($x$) and ($y$) in addition to the luminance coordinate ($Y$).

CIE chromaticity diagram

Figure 3: The CIE chromaticity diagram, showing colors for all combinations of the chromaticity coordinates ($x$) and ($y$), as far as those belong to perceivable colors. Source: https://en.wikipedia.org/wiki/Chromaticity#/media/File:PlanckianLocus.png

The CIE chromaticity diagram (Figure 3) would ideally display the true color tones for all ($x, y$) pairs in the perceivable range of colors, which corresponds to a horseshoe-shaped part of XYZ color space, called the gamut of human vision. Unfortunately, a computer monitor can display colors only in a limited part of the XYZ color space, e.g. the sRGB color space (see below), and even in that limited space the colors may not be accurate if one does not take special precautions, such as a careful color calibration according to the color space of the displayed image. Therefore, such CIE chromaticity diagrams, whether printed on paper or displayed on a screen, are usually showing colors only in quite approximate ways. A rather accurate reproduction could in principle be done with a laser-based display employing carefully controlled mixtures of several primary colors, e.g. deep red at 700 nm, green at 530 nm, blue-green at 500 nm and blue-violet at 480 nm. That would go substantially beyond the color limitations of displays with RGB sources (using three primary colors), but would also be correspondingly more complex and expensive, and is therefore uncommon.

The primary colors of CIE XYZ color space (e.g. with X = 1, Y = Z = 0) are imaginary colors, i.e., they cannot be physically realized. Colors for monochromatic light are located on the spectral locus of the chromaticity diagram, which is the curved boundary of the shown gamut; wavelength values in nanometers are indicated in Figure 3. The lower boundary of the gamut, called the line of purples, basically represent some mixtures of red and violet, which cannot be reached with monochromatic light.

White light with a flat power spectrum (CIE standard illuminant E) corresponds to the point with ($x = y = 1/3$). In real life, one may encounter different white color tones like warm white (somewhat shifted towards yellow-orange), cold white (with higher blue content), etc. Figure 3 also shows the color values of blackbody radiation (thermal radiation with spectrally uniform emissivity) for a range of temperatures.

Note that distances in CIE XYZ color space do not well reflect differences in perceived color tones; that deficiency of the system has led to the development of various other color spaces such as CIELUV, CIEUVW, and CIELAB, which are better in that respect and others. Relatively common e.g. for-color calculations is CIELAB (L_a_b_) with a luminance coordinate L_ and two chromaticity coordinates a (green to magenta) and b (blue to yellow).

RGB Color Spaces

On computer monitors and projection displays with RGB sources, colors are usually obtained by additive mixing of red, green and blue light. For example, these may be emitted by different phosphors of a cathode ray tube (CRT) or by light-emitting diodes, or obtained with a suitable optical filters from an LED background light or a high intensity discharge lamp. For such applications, it is obviously convenient to have colors defined with RGB (red–green–blue) coordinates, i.e., in an RGB color space. One may then directly control the red, green and blue intensities according to the color coordinates, or sometimes first needs to apply a transformation.

In principle, one may also work with a different set of colors, but with a combination of red, green and blue one can best produce a reasonably large color gamut.

The RGB color model defines only the basic principle; one also needs to define the exact primary colors and some other details (e.g. a gamma function). There is a substantial number of different RGB color spaces:

Note that mathematically one can cover the complete gamut of human vision with RGB coordinates, if one allows those to become negative. However, a pixel of a color monitor cannot contribute less than no green light at all, for example, although that would be required to generate color impressions in the deepest red region. Usually, one considers only non-negative RGB values, corresponding to colors which can physically be generated by mixing the used primary colors.

Devices using RGB color profiles are often equipped with a color profile (most often based on a definition from ICC, the International Color Consortium), which essentially defines more closely the used primary colors. One may, for example, use a colorimeter to generate a color profile of a computer monitor; the resulting file can then be used for properly adjusting the color values, e.g. such that the RGB color space of available media is accurately reproduced. Also, a photo camera may embed its color profile into produced JPEG images files to clearly define what color space has been used.

CMYK Color Spaces

CMYK color spaces are based on a subtractive color model, as is appropriate in the context of printing, where colors are generated by mixing pigments or dyes. Here, each segment absorbs light within some range of wavelengths. CMYK values essentially specify what concentrations of C (cyan), M (magenta), Y (yellow) and K (black) pigments or dyes (e.g. in inkjet printers) need to be mixed to obtain the corresponding color. Although human vision is trichromatic, meaning that three different pigments would in principle be sufficient, a combination of four has been chosen to obtain a wider color gamut. Nevertheless, CMYK color gamuts are relatively narrow, with substantial deficiencies particularly in the blue–green region, but also for deep red color tones. This reflects the fundamental difficulties of achieving such colors with pigments. If a pigment were to generate a very “pure” color (close to some monochromatic light), it would have to absorb all light outside a narrow wavelength band, and leave only a tiny portion of the incident optical power. However, for subtractive color mixing to work reasonably well, one needs to have substantially overlapping spectral regions with low absorption, and that inevitably leads to broadband light with quite limited color saturation.

Transformations between Color Spaces

It is possible to do transformations between different color spaces, i.e., to calculate the color coordinates in one space from those in another space. That is required, for example, when a printing device needs CMYK data while the images are from a photo camera delivering sRGB image data. In some cases, one needs to first transform into some intermediate color space (e.g. CIE XYZ) before getting to the final color space.

Unfortunately, color transformations often do not perfectly work:

When transforming an image into another color space and back again, the final result may significantly differ from the original image, particularly because of limited color spaces, but also because of rounding errors.

Incomplete, misleading or just wrong specifications of color spaces, causing wrong transformations and other problems, are unfortunately quite common. Note that a complete understanding of color vision, colorimetry and all the details of color spaces is rather hard to acquire, and is far from what many persons dealing with such things can achieve.

Frequently Asked Questions

What is a color space?

A color space is a system for specifying colors objectively using numerical coordinates, typically three values called tristimulus values. It creates a structured mapping between perceivable colors and a mathematical model.

Why do most color spaces have three dimensions?

Most color spaces are three-dimensional because human vision is trichromatic, relying on three types of cone cell receptors in the eye. The three dimensions correspond to the responses of these receptors.

What is the difference between additive and subtractive color models?

Additive color models, like RGB for displays, start with black and add primary colors of light (red, green, blue) to create other colors. Subtractive models, like CMYK for printing, start with white and use pigments to absorb (subtract) wavelengths of light.

What is a color gamut?

A color gamut is the complete range of colors that can be represented within a particular color space or reproduced by a specific device like a monitor or printer.

What is the CIE XYZ color space?

The CIE 1931 XYZ color space is a foundational, device-independent system that mathematically encompasses all colors visible to the average human eye. It serves as a standard reference for defining other color spaces.

Why can't my monitor display all the colors humans can see?

A monitor creates colors by mixing red, green, and blue light, which limits its color gamut. The full gamut of human vision includes colors, particularly in the deep red and blue-green regions, that cannot be reproduced by such a mixture.

What is the difference between sRGB and Adobe RGB?

Both are RGB color spaces, but Adobe RGB has a wider color gamut than sRGB, particularly in the green region. sRGB is the common standard for web content, while Adobe RGB is often used in professional photography and print production.

Why is the CMYK model used for printing?

The CMYK model is used for printing because it is subtractive, which matches the process of inks on paper absorbing light to create colors. It uses cyan, magenta, yellow, and black (K) pigments to achieve a wide range of printable colors.

What are imaginary colors in a color space?

Imaginary colors are coordinates within a color space, such as CIE XYZ, that are a mathematical necessity to encompass all real colors but do not correspond to any color that can be produced by a physical light source.

Questions and Comments from Users

Here you can submit questions and comments. As far as they get accepted by the author, they will appear above this paragraph together with the author’s answer. The author will decide on acceptance based on certain criteria. Essentially, the issue must be of sufficiently broad interest.

Please do not enter personal data here. (See also our privacy declaration.) If you wish to receive personal feedback or consultancy from the author, please contact him, e.g. via e-mail.

By submitting the information, you give your consent to the potential publication of your inputs on our website according to our rules. (If you later retract your consent, we will delete those inputs.) As your inputs are first reviewed by the author, they may be published with some delay.