← BLOG🏠 luckyplz.com
The Science of Color · Part 2

Turning Color into Numbers

From CIE 1931 to CIEDE2000 — the century in which humanity measured color and pinned it to coordinates
← Part 1  How We See Color

In Part 1 we saw that color is, in the end, the ratio of three numbers, L, M, S. But to convey 'the red I see' to someone else precisely, you need not a feeling but a standard coordinate everyone can reproduce. In 1931 the International Commission on Illumination (CIE) sat people at a bench and measured color, and the result became the basis of every display, camera, and print today.

1. Measuring color — color matching

The method is surprisingly simple and beautiful. A round field is split in two: one half is lit by the monochromatic light being measured (a single wavelength). The other half is lit by a mix of three primaries — red (700nm), green (546.1nm), blue (435.8nm).

The observer turns the brightness knobs of the three primaries until the two halves look identical. The three values R, G, B at the match are that wavelength's color expressed as 'coordinates in three primaries'. Repeat across every visible wavelength and you get three curves: how much R, G, B each wavelength needs.

test mixture test source single wavelength three primaries + intensity R 700nm G 546nm B 436nm observer 2° field turn the three intensities until both halves look identical
Figure 1. The color-matching experiment. A field is split: one half shows a monochromatic test light, the other a mix of three primaries (R 700, G 546, B 436nm). The observer turns the knobs until the two halves look identical.

2. The color-matching functions r̄ ḡ b̄

These three curves are the color-matching functions. r̄(λ), ḡ(λ), b̄(λ) tell you how much R, G, B is needed to reproduce each wavelength. The color of any light is obtained by integrating against them.

But on first sight something looks odd. Part of r̄(λ) dips below zero — it goes negative. What on earth does it mean to add a 'negative amount' of light? Everyone learning color matching pauses here.

Wavelength (nm) Value 0 400 450 500 550 600 650 700 b̄(λ) ḡ(λ) r̄(λ) negative region
Figure 2. The CIE RGB color-matching functions — how much R, G, B each wavelength needs. Notice that r̄(λ) dips below zero, going negative, roughly between 440–545nm.
Color-matching simulation ● LIVE
The monochromatic source (left) makes the test color, the three primaries (right) make the mix. In the cyan band R turns negative, so instead of the right side the auxiliary source (left) lights up and adds R to the test color — that is the negative in the color-matching function.
400 700 nm test mix mono source test color aux source +R (trick) 3 primaries R G B observer 2° field primary intensity (R·G·B) 0 R G B R < 0 → auxiliary color-matching functions r̄ ḡ b̄ 400 700 nm
400 nm

3. Why does it go negative?

Here is the key. A certain cyan (around 500nm) monochromatic light is so pure and saturated that no amount of red, green, and blue added together can reach it. Mixing only makes it duller.

So the experimenter flips the idea. Instead of the primary side, they add a little red to the cyan test light itself, slightly dulling it, then match it with the remaining green + blue. As an equation: 'test + red = green + blue', i.e. 'test = green + blue − red'. That subtracted red is exactly the negative r̄.

In other words, the negative is the record of 'light added to the other side'. Nothing physically subtracts light; rather, the limit of human color vision — that some colors can only be matched by subtracting — is written into the numbers. It also means no three real primaries can express every color with positive amounts alone.

1 R+G+B can't reach it 2 add red to the test side dull vividness (chroma) → max R+G+B mix pure 500nm no mix is as saturated as pure cyan cyan + R = G+B test = G + B − R the subtracted red (−R) is the negative r̄
Figure 3. The meaning of negative. A saturated cyan (≈500nm) cannot be made by adding R, G, B. So red is added to the test side to dull it, then matched — in the equation that red appears subtracted (−R), recorded as negative.

4. X, Y, Z — removing the negatives

Negatives were inconvenient for calculation, so the CIE made a clever transform: it defined three imaginary primaries X, Y, Z that do not physically exist. They are more saturated than any real light, impossible to produce, yet they work perfectly as coordinates.

Rewritten in these primaries, all the matching functions x̄, ȳ, z̄ are positive everywhere. Better still, ȳ(λ) is designed to match perceived brightness, so the single value Y is luminance.

For any light S(λ), integrating as below yields three numbers X, Y, Z — the tristimulus values. The 'three numbers L, M, S' of Part 1 are here standardized into three numbers X, Y, Z.

X = ∫ S(λ) x̄(λ) dλ    Y = ∫ S(λ) ȳ(λ) dλ    Z = ∫ S(λ) z̄(λ) dλ
Wavelength (nm) Value (all positive) 400 450 500 550 600 650 700 z̄(λ) ȳ(λ) x̄(λ)
Figure 4. The CIE 1931 XYZ color-matching functions. Rewritten in the imaginary primaries X, Y, Z, all three functions are positive everywhere. ȳ(λ) is designed to match perceived brightness (luminance).

5. The CIE 1931 chromaticity diagram — the horseshoe

Tristimulus X, Y, Z are three-dimensional, awkward to draw on paper. So we strip out brightness and project just 'hue and saturation' into 2D (formula below). That (x, y) plane is the famous horseshoe diagram.

The outer curve is pure monochromatic light, the spectral locus; the bottom straight line is the purple line joining red and blue; the center is the white point. Every real color falls inside this horseshoe. A display's color range (its gamut) is drawn as a triangle within it — sRGB, DCI-P3, BT.2020 are ever-larger triangles.

x = X / (X+Y+Z)     y = Y / (X+Y+Z)
0.2 0.2 0.4 0.4 0.6 0.6 x y 460 480 490 500 510 520 540 560 580 600 620 680 sRGB gamut white D65
Figure 5. The CIE 1931 xy diagram. The outer curve is pure monochromatic light (the spectral locus), the bottom line is the purple line, the center is the white point. Every real color lies inside. A display's gamut is a triangle within it.

6. The limit of 1931 — it isn't uniform

CIE 1931 was a revolution, but it has one weakness: on the diagram, equal distances do not mean equal 'color differences'.

In 1942 MacAdam measured the boundary at which people can 'just barely notice' a difference, and it came out as small ellipses. The problem is that the size and orientation of these ellipses vary by location — enormous in the green region (insensitive), tiny in blue (sensitive). So measuring the distance between two colors on the diagram does not track what people actually perceive.

To manage color — to judge with a single number whether two panels are close enough, say — you needed a more uniform coordinate where distance equals difference.

0.2 0.2 0.4 0.4 0.6 0.6 green: large blue: small ellipses ×10 exaggerated — size/orientation vary by location
Figure 6. MacAdam ellipses (schematic). The boundary of 'just-noticeable' color difference varies wildly in size and orientation by location — huge in green (insensitive), tiny in blue (sensitive). Distance ≠ perceived difference.

7. More uniform — CIE 1976 u'v' and CIELAB

The first fix was to nonlinearly re-stretch the coordinates so the MacAdam ellipses become as close to circles as possible. That gave the CIE 1976 UCS, the u'v' diagram (formula below); the ellipses spread out far more evenly.

The same year the CIE went further and defined a 3D uniform color space including lightness, CIELAB (L*a*b*). L* is lightness (0 black to 100 white), a* runs green(−)↔red(+), b* blue(−)↔yellow(+) — the opponent structure from Part 1, turned directly into axes.

The transform divides XYZ by a reference white, then passes it through a cube-root-like function. The key effect is simple: color difference can now be measured as just the distance between two points.

u′ = 4X / (X+15Y+3Z)     v′ = 9Y / (X+15Y+3Z)
L* = 116·f(Y/Yn) − 16
a* = 500·[f(X/Xn) − f(Y/Yn)]    b* = 200·[f(Y/Yn) − f(Z/Zn)]
0.2 0.2 0.4 0.4 0.6 0.6 u′ v′ 460 480 490 500 510 520 540 560 580 600 620 680 white D65
Figure 7. The CIE 1976 u'v' diagram. The 1931 horseshoe stretched nonlinearly so that color difference depends less on location. The green region is compressed and the whole spreads more evenly.
+a* red −a* green +b* yellow −b* blue L* lightness 100 (white) 0 (black)
Figure 8. The CIELAB color space. L* is lightness (0–100), a* runs green(−)↔red(+), b* blue(−)↔yellow(+). The opponent structure from Part 1, turned straight into axes. The a*b* plane is a true-color hue-chroma wheel.

8. Completing color difference — ΔE76 to CIEDE2000

In CIELAB the difference between two colors is a Euclidean distance, ΔE*ab (formula below, 1976). Intuitive and long used, but CIELAB is not perfectly uniform either, diverging from perception especially in the blue and high-chroma regions.

So corrections came in 1994 and then 2000. The current industry standard, CIEDE2000 (ΔE00), weights lightness, chroma, and hue differences separately (SL, SC, SH), discounts differences more at high chroma, and adds a rotation term (RT) to capture the hue–chroma interaction in the blue region.

The formula is long and complex, but its goal is one thing: to make the single computed ΔE match what people actually perceive. A ΔE00 of about 1 is a difference a trained eye can barely tell apart — and that is the quality bar for displays, print, and paint today.

ΔE*ab = √( ΔL*² + Δa*² + Δb*² )
ΔE00 = √[ (ΔL′/kLSL)² + (ΔC′/kCSC)² + (ΔH′/kHSH)² + RT·(ΔC′/kCSC)(ΔH′/kHSH) ]
ΔE ΔE*ab (1976) straight distance in CIELAB CIEDE2000 SL lightness weight SC chroma weight SH hue weight RT blue-region rotation goal: one number = the difference people perceive
Figure 9. The evolution of color difference ΔE. ΔE76 is a plain Euclidean distance; CIEDE2000 adds weights for lightness/chroma/hue (SL·SC·SH) and a blue-region correction (the rotation term RT) to fit perception.

Closing the two parts

If Part 1 was the biology of 'the eye making color', Part 2 was the history of the standard that 'pinned that color to numbers everyone shares'. From three cones L, M, S to the tristimulus X, Y, Z, the horseshoe diagram, and CIEDE2000 — the reason we can call the color on our screens 'accurate' is this century of measurement. How these coordinates are used in real displays, for gamut, calibration, and color management, is for another time.

← Part 1  How We See Color
By Lucky Please
Technical explainers on color science and display optics. The scientific content is based on public academic and standards (CIE) material; all diagrams are original.