What is a Color Space?
Color Space
A color space is a system that gives each color a measurable numeric value, based on an underlying colorimetric model.
The same color can be written in several color spaces, or converted from one to another, and still look the same. The color does not change. Only the numbers that name it change.
Why a color space has three numbers
The human retina has three classes of cone. These are the short-wavelength (S), middle-wavelength (M) and long-wavelength (L) cones. Their sensitivity peaks lie near 440, 545 and 565 nm. Two lights with different spectra can look the same color, and a color can be matched by a mix of three primary lights. For this reason a color space needs three numbers for each color. An LMS space describes cone responses directly.
Main color spaces
- RGB is additive. Red, green and blue lights add up to cyan, magenta, yellow and white. Screens use RGB. sRGB, Display P3 and Rec. 2020 are RGB spaces.
- CMY is subtractive. Cyan, magenta and yellow filters absorb red, green and blue from white light. Color filters work this way.
- HSL and HWB are cylindrical forms of sRGB. They give a hue angle plus a lightness or a whiteness and a blackness. They are easy to read but they are not perceptually uniform.
- CIE XYZ is the reference space of the International Commission on Illumination (CIE). Measuring instruments report it, and many conversions pass through it.
- CIELAB and CIELUV are CIE spaces from 1976. They aim at perceptual uniformity, so a distance in the space approximates a color difference.
- Oklab is a newer space. The CSS Color specification says it is more perceptually uniform than CIE Lab.
- Munsell is a system of color samples. It has three dimensions: hue, value and chroma.
CIE XYZ
The CIE system of colorimetry dates from 1931. Around 1930 Wright and Guild asked observers to match colors with three primary lights in a 2 degree field. The CIE adopted the results as standard red, green and blue matching functions. The CIE then transformed them into a new set, X, Y and Z, to remove negative values. The XYZ primaries are imaginary, so every real color has positive values.
The Y component is the luminance. The 1931 standard observer applies to a field of view up to 4 degrees. In 1964 the CIE added a 10 degree observer for larger fields.
Chromaticity
A chromaticity coordinate removes the luminance. The coordinates are x = X/(X+Y+Z) and y = Y/(X+Y+Z). Their sum with z is 1, so the pair (x, y) is enough. It places a color on the CIE chromaticity diagram.
The CIE also defined the 1976 uniform chromaticity scale. Its coordinates are u’ = 4X/(X+15Y+3Z) and v’ = 9Y/(X+15Y+3Z). It is a significant improvement on the (x, y) diagram, but it is still not perfect.
Chromaticities are additive. A mixture of two colors lies on the line that joins them on the diagram. A mixture of three colors lies inside the triangle that they form.
Worked example. The D65 white point is about 6500 K, a daylight white. In CSS Color it has X = 0.9504559, Y = 1 and Z = 1.089058. The sum is 3.0395139. So x = 0.9504559 / 3.0395139 = 0.3127 and y = 1 / 3.0395139 = 0.3290. The 1976 values are u’ = 3.8018236 / 19.21763 = 0.1978 and v’ = 9 / 19.21763 = 0.4683.
sRGB
sRGB is a device-independent color space for displays and the web. Hewlett-Packard and Microsoft proposed it. The International Electrotechnical Commission (IEC) standardized it as IEC 61966-2-1, which covers the encoding and communication of RGB colors in computer systems. It uses the ITU-R BT.709 primaries and the D65 white point. Its transfer curve is close to gamma 2.2. The curve is neither linear-light nor perceptually uniform. The CSS Color specification treats a color without a tagged color space as sRGB.
CIELAB and CIELUV
In 1976 the CIE recommended CIELAB and CIELUV. These spaces use XYZ and a reference white point as input, so they correct for chromatic adaptation to the white point. CIELAB is the one that imaging applications commonly use.
In CIELAB, L* is the lightness. It runs from 0 for black to 100 for white. The a* axis runs from green to red. The b* axis runs from blue to yellow. CSS Color computes Lab with a D50 white, a daylight standard of 5000 K. LCH is the polar form of Lab. C is the chroma and H is the hue angle.
Color difference
The difference between two colors is the Euclidean distance between their points. This is the CIE 1976 formula:
delta Eab = square root of (delta L² + delta a² + delta b²)
Worked example. Take two colors, (L*, a*, b*) = (50, 20, 30) and (53, 24, 30). The differences are 3, 4 and 0. So delta E*ab = square root of (9 + 16 + 0) = 5.
Chroma is Cab = square root of (a² + b²). Hue is the angle h = arctan(b/a*). For the first color, C*ab = square root of 1300, which is 36.1, and h = 56.3 degrees.
The chroma scale of delta E*ab is fairly nonlinear. The CIE therefore recommended the improved CIE94 formula in 1994. The CMC formula serves mostly the textile industry.
Gamut
A gamut is the range of colors that a device can produce. A real device cannot produce every color that the eye can see. After linearization, an RGB space is additive. Its gamut is the triangle of its red, green and blue primaries on the chromaticity diagram. The white point is the color that all three primaries make at full intensity.
A color is in gamut for a device when the device can display it. Otherwise it is out of gamut. Expressed in the screen’s own space, an out-of-gamut color has a coordinate above 1 or below 0. It then needs gamut mapping before display.
Converting between color spaces
Conversions often pass through XYZ. A change of white point needs a chromatic adaptation step. The linear Bradford transform is the industry standard. CSS Color uses it to go from D65, the white of sRGB, Display P3, A98 RGB and Rec. 2020, to the D50 white of Lab.
Common mistakes
- Reading an untagged color as if it had a known space. CSS Color treats it as sRGB.
- Comparing Lab values that use different white points. The Lab values depend on the white point.
- Treating delta E as an exact measure of what a person sees. The Lab space aims at perceptual uniformity and does not reach it fully.
- Giving a color as RGB values without the space. The same numbers give different colors in sRGB and Display P3.
Color spaces in airfield standards
Airfield standards do not use RGB. ICAO Annex 14 Appendix 1 and EASA CS ADR-DSN Chapter U define the colors of aeronautical ground lights, markings, signs and panels as chromaticity limits. The limits are lines in the CIE (x, y) plane. For example, the red boundary on the purple side is y = 0.980 - x. For red lights on visual approach slope indicator systems, the yellow boundary is y = 0.320 instead of y = 0.335.
The same chapters set the test conditions for surface colors. The illumination angle is 45 degrees, the direction of view is perpendicular to the surface, and the illuminant is CIE D65. For light emitting diode (LED) lights, the boundaries come from CIE S 004/E-2001, except for the blue boundary of white.
Frequently Asked Questions
- What is a color space?
- A color space is an organization of colors with respect to an underlying colorimetric model. Every color in it has a clear, objectively measurable meaning. The same color can be written in several color spaces, or converted from one to another, and still look the same.
- What is the LMS color space?
- LMS describes a color by the response of the three types of cone in the human retina. L cones respond to long wavelengths, M cones to medium wavelengths and S cones to short wavelengths. Their sensitivity peaks lie near 565, 545 and 440 nm. Three cone types are why a color space needs three numbers.
- What is the difference between CIE XYZ and sRGB?
- CIE XYZ is the reference system for color measurement, defined by the CIE in 1931. sRGB is a standard color space for displays and the web, standardized as IEC 61966-2-1. It uses ITU-R BT.709 primaries, a D65 white point and a curve close to gamma 2.2.
- What is the CIELAB (Lab) color space?
- CIELAB is a CIE color space of 1976 that aims at perceptual uniformity. L* is lightness from 0 for black to 100 for white. The a* axis runs from green to red and the b* axis from blue to yellow. It takes XYZ and the white point as input.
- How do you calculate a color difference in CIELAB?
- Take the Euclidean distance between the two colors. Delta E*ab is the square root of the sum of the squares of the differences in L*, a* and b*. For (50, 20, 30) and (53, 24, 30) the differences are 3, 4 and 0, so delta E*ab is 5.
- What is a chromaticity coordinate?
- A chromaticity coordinate is a color value that does not include luminance. In the CIE system, x = X/(X+Y+Z) and y = Y/(X+Y+Z). The pair (x, y) places a color on the CIE 1931 chromaticity diagram. The D65 white point is at about (0.3127, 0.3290).
- What is a color gamut?
- A gamut is the range of colors that a device can produce. A color is in gamut for a screen or printer when the device can show it, and out of gamut when it cannot. For an RGB space the gamut is the triangle that the three primaries form on the chromaticity diagram.
- In which color space are aviation light colors defined?
- ICAO Annex 14 Appendix 1 and EASA CS ADR-DSN.U.930 define them as chromaticity limits. The limits use the CIE 1931 standard observer. They are lines in the (x, y) plane. They are not RGB or Lab values.
References
- w3c-css-color-4
- CSS Color Module Level 4 W3C
- ohno-2000-cie-fundamentals
- CIE Fundamentals for Color Measurements (IS&T NIP16) Yoshi Ohno, NIST
- w3c-srgb
- A Standard Default Color Space for the Internet: sRGB W3C (historical page)
- icao-annex-14-vol-i-9ed
- ICAO Annex 14, Volume I, Aerodromes, 9th edition (July 2022) ICAO
- easa-ear-aerodromes
- Easy Access Rules for Aerodromes (Regulation (EU) No 139/2014), CS-ADR-DSN Issue 7 EASA
- cie-015-2018
- CIE 015:2018 Colorimetry, 4th Edition CIE
- webvision-color-perception
- Color Perception (Webvision, Part VIII: Psychophysics of Vision) Kalloniatis and Luu, Moran Eye Center, University of Utah
This is a reference entry. TarmacView provides drone inspection services and doesn't sell the equipment or materials described in this glossary.