30

CIE XYZ Explained

Almost every modern statement about color - sRGB, ICC, Lab, Display P3, ΔE - is ultimately defined in terms of one shared frame of reference. That frame is CIE XYZ, published in 1931. This article opens the box: where the numbers came from, what the matching functions mean, and why XYZ is the hub of modern color science.

Colorimetry · 08 9 Live Demos ~50 min read Wright/Guild → modern
1931
CIE XYZ published
17
Wright/Guild subjects
Field of view (1931)
10°
Supplementary (1964)
00

Advanced XYZ workbench

CIE XYZ is the bridge between spectra, human observer functions, chromaticity diagrams, luminance, RGB working spaces, and profile connection spaces. This workbench exposes the whole pipeline in one place: build a spectrum, choose the standard observer and reference white, integrate to XYZ, project to xyY, then test whether the result fits a real RGB display space.

Interactive 00 - Advanced colorimetry pipeline

From spectral power to XYZ, xyY, and RGB gamut risk

Change the source mode, observer, illuminant, output RGB space, wavelength, bandwidth, luminance, chroma, and metamer blend. The canvas redraws the spectrum, matching function contribution, chromaticity location, and the selected RGB-space encoding.

XYZ tristimulus X -- Y -- Z --
xyY chromaticity x -- y -- Y --
Encoded RGB --
Observer / white --
Gamut status --
Interpretation --
X contribution 0%
Y luminance contribution 0%
Z contribution 0%
RGB clipping risk 0%

XYZ preserves color matches, not spectra. Two different spectral shapes can land on nearly the same tristimulus point, which is why color management can work and why metamerism never fully disappears.

01

What XYZ is

CIE XYZ is a three-dimensional coordinate system in which every visible color sits at a unique point. Coordinates are non-negative real numbers, two of them roughly proportional to chromatic information (X and Z) and one proportional to luminance (Y). Two stimuli with identical XYZ triples look identical to the standard observer under the same viewing conditions, regardless of what their underlying spectra are.

That is the entire promise. Take any spectrum, integrate it against three published weighting functions called the color matching functions, and you get three numbers - X, Y, Z - that fully describe what the average human will see. Two laboratories on different continents, with different equipment, looking at different physical samples, can compute the same XYZ from a measurement and agree on the color. Before 1931, this was not possible.

The crucial verb is "integrate." XYZ is what you compute by collapsing a continuous spectrum onto three weighted sums. The spectrum lives in a function space of effectively infinite dimensions; XYZ lives in three. This is the same dimensionality reduction that human cones perform - the CIE deliberately built XYZ to behave like an idealized version of the eye.
02

The Wright/Guild experiments

In the late 1920s two British researchers ran the experiments that became the empirical foundation of XYZ. W. David Wright at Imperial College and John Guild at the National Physical Laboratory each built an apparatus with three primary lights that could be mixed in adjustable proportions. Observers looked into the apparatus at a split visual field: a test wavelength on one side, the three-primary mix on the other. They adjusted the mix until the two halves matched.

Doing this for many wavelengths across the visible spectrum, with seventeen observers in total, produced a tabulated function that said "to match wavelength λ, take this much red, this much green, this much blue." Those tabulated functions are called color matching functions. Wright used 650 / 530 / 460 nm primaries; Guild used a different set; but when both data sets were transformed to a common pair of primaries, they agreed almost exactly.

Wright (1928-29)
10 observers, monochromatic primaries at 650, 530, 460 nm.
Guild (1931)
7 observers, broader-band primaries. Independent of Wright's apparatus.
Combined CIE 1931
Both data sets transformed to a common 700/546.1/435.8 nm primary basis and averaged. Became r̄(λ), ḡ(λ), b̄(λ).
XYZ derivation
The CIE then linearly transformed the rgb matching functions into the all-positive XYZ basis we use today.
"The match the observer made was independent of their reasoning - they simply turned knobs until the field looked uniform. The brain's color computer did the rest." Editorial summary · Wright-Guild methodology
03

Color matching functions

The color matching functions (CMFs) are the heart of XYZ. There are three of them: x̄(λ), ȳ(λ), z̄(λ) ("x-bar," "y-bar," "z-bar"). Each one is a curve of weight versus wavelength. Multiply a stimulus spectrum by one of them and integrate, and you get one of the tristimulus values. Three CMFs, three tristimulus values, one color description.

X = k ∫ Φ(λ) x̄(λ) dλ,   Y = k ∫ Φ(λ) ȳ(λ) dλ,   Z = k ∫ Φ(λ) z̄(λ) dλ tristimulus values as spectral integrals
Interactive 01 · CIE 1931 2° CMFs

Probe the three matching functions

The curves are (red), ȳ (green - identical to V(λ) by design), and (blue). Slide the wavelength marker. The three numbers below tell you how much "X-ness," "Y-ness," and "Z-ness" a monochromatic light of that wavelength contributes per unit power.

x̄(λ) ȳ(λ) z̄(λ)
x̄ at this wavelength
0.000
ȳ at this wavelength
1.000
z̄ at this wavelength
0.000
Resulting color (1 unit power)
#88ee44
Chromaticity (x, y)
0.330, 0.660
04

Why imaginary primaries

The Wright/Guild data, expressed in the original rgb primaries, contained negative numbers - some spectral colors required "subtracting" red, which in the real apparatus meant adding the matching primary to the test side rather than the comparison side. Calculations with negative values are awkward and lead to negative tristimulus quantities that have no physical interpretation.

The CIE solved this by choosing three new primaries - X, Y, Z - that were intentionally outside the gamut of visible colors. No physical light can produce the X, Y, or Z primaries. But because they sit outside the gamut, any real color can be expressed as a positive combination of them. The three new primaries are "imaginary" or "non-physical" in the sense that they cannot be realized with a physical light source - but they make the math clean and the tristimulus values always positive.

Why three?
Because human vision is trichromatic. Three matching functions exactly span the dimensionality of color experience.
Why non-negative?
By choosing primaries outside the visible gamut, every real color requires only positive amounts of each primary - no subtraction needed.
Why Y = luminance?
The CIE deliberately aligned ȳ(λ) with the photopic luminosity function V(λ). One of the three tristimulus coordinates therefore directly encodes brightness.
Why no purple/magenta primary?
X and Z each have a "lobe" that captures the warm and cool ends of the spectrum without needing a fourth primary. The split design lets Y carry luminance cleanly.
"X, Y, and Z are not colours. They are arithmetic conveniences that make every real colour fit inside a triangle with positive coordinates." Editorial summary · CIE 1931 derivation
05

Tristimulus integration

Now we can write the full operational definition. For a self-luminous stimulus Φ(λ) - measured in watts per nanometer - the tristimulus values are

X = 683 ∫ Φ(λ) x̄(λ) dλ
Y = 683 ∫ Φ(λ) ȳ(λ) dλ
Z = 683 ∫ Φ(λ) z̄(λ) dλ integration from 380 to 780 nm; k = 683 lm/W aligns Y with photopic lumens

For a reflective object, the stimulus is reflectance times illuminant, and you normalize by the illuminant's tristimulus values so that a perfect diffuse white under the same illuminant produces Y = 100.

X = 100 · ∫ R(λ) S(λ) x̄(λ) dλ / ∫ S(λ) ȳ(λ) dλ tristimulus for a reflective sample under illuminant S(λ)
Interactive 02 · Spectrum → XYZ

Compose a stimulus and watch X, Y, Z emerge

Build a SPD with three Gaussian components. The system integrates against the 1931 2° CMFs and shows you the resulting tristimulus values, chromaticity coordinates, and approximate sRGB swatch.

X tristimulus
0.000
Y tristimulus
0.000
Z tristimulus
0.000
Chromaticity (x, y)
Approximate appearance
#888888
06

xyY chromaticity coordinates

The three tristimulus values entangle two pieces of information: how much light is there (intensity) and what color it is (chromaticity). To plot colors on a flat map - to draw the famous CIE chromaticity diagram - we project XYZ onto a plane by normalising.

x = X / (X + Y + Z),   y = Y / (X + Y + Z) chromaticity coordinates (x + y + z = 1 by construction)

The xyY representation keeps x and y as chromaticity and uses Y directly as luminance. Two stimuli with the same (x, y) but different Y are the same color at different brightnesses. xyY is the basis for almost every published color diagram you have ever seen.

Interactive 03 · XYZ → chromaticity

Click anywhere on the chromaticity diagram

The famous horseshoe is the locus of monochromatic colors in xy space - the most saturated colors a human can see. The straight bottom edge is the "line of purples," which mixes red and violet and contains no spectral wavelength. Click inside the gamut to drop a probe.

CIE 1931 xy chromaticity
x
0.330
y
0.330
z (= 1 - x - y)
0.340
Approximate appearance
#ffffff
Notable point
D65 white point neighborhood
07

2° vs 10° observers

The CIE published two standard observers. The original 1931 2° observer was based on Wright/Guild data, who used a 2-degree wide test field on the retina - small enough that the image fell entirely within the cone-dense fovea. The 1964 10° supplementary observer was added later using larger field experiments - representing what happens when the test area extends into the cone periphery, where rod and cone densities differ.

The two observers disagree slightly. The 10° matching functions are flatter and shift a bit because the larger field includes more peripheral cones and some rod influence. Picking the wrong observer for a given application can produce disagreements as large as a few ΔE units. Modern color management defaults to the 2° observer for most computational work but uses 10° for printed-textile and paint-chip comparisons where the sample field is genuinely large.

2° standard observer (1931)
Use for: computer displays, web color, photography, general digital imaging. Field is roughly the size of a thumbnail at arm's length.
10° supplementary observer (1964)
Use for: paint, textile, printed material under larger viewing fields. Field is roughly the size of a clenched fist at arm's length.
CIE 2006 cone fundamentals
Modern alternative based on LMS cone sensitivities rather than empirical matching, with field-size and age parameters built in.
Two laboratories using different observers will get different XYZ for the same physical sample. The disagreement is small but real. Color workflows should specify the observer alongside the illuminant when documenting any XYZ-based measurement.
08

Reference white points

XYZ alone does not tell you what "white" is - it just gives coordinates. To convert between color spaces you need to specify a white point: the XYZ of whatever the system considers a neutral reference. Every standard color space picks its white. sRGB and Rec.709 use D65. Adobe RGB also D65. ICC profile-connection space defaults to D50. Cinema's DCI uses a slightly green-shifted "DCI white."

Interactive 04 · White point atlas

Six standard white points on the chromaticity diagram

Each white point has its own xy coordinates. Pick one from the dropdown; the marker on the chromaticity locus moves to that position, and the swatch shows the approximate appearance.

D65 daylight
x
0.3127
y
0.3290
Correlated CT
6504 K
X / Y / Z (Y = 100)
95.05 / 100.00 / 108.88
Typical use
Web, displays, sRGB
D65
sRGB · Rec.709 · Rec.2020
D50
ICC PCS · ISO 3664 print
D60
ACES cinema
DCI
Digital cinema P3
09

XYZ ↔ sRGB transforms

Every RGB color space is defined by a matrix transform between its linear-light RGB primaries and CIE XYZ. The standard sRGB matrix (D65, ICC v4, IEC 61966-2-1) is:

[ X ]
[ Y ]
[ Z ]
= 0.41240.35760.1805 0.21260.71520.0722 0.01930.11920.9505 [ Rlin ]
[ Glin ]
[ Blin ]
sRGB → XYZ matrix (D65 white point, linearized values)

Two crucial details. First, the inputs must be linear-light RGB, not the gamma-encoded RGB that comes out of a typical image file. You have to undo the sRGB transfer function first - approximately a 2.2 power, exactly a piecewise curve. Second, the matrix is space-specific. Adobe RGB has a different matrix. Display P3, Rec.2020, ProPhoto - all different. The matrix entries encode each space's primary chromaticities and its white point in a single transform.

Interactive 05 · sRGB ↔ XYZ converter

Round-trip a color through XYZ

Type a hex value or use the sliders. The system gamma-decodes it to linear sRGB, multiplies by the sRGB → XYZ matrix, then inverts to recover the original. The round-trip should be exact within rounding.

sRGB (encoded)
255, 212, 0
Linear RGB
1.000, 0.679, 0.000
XYZ (Y = 100)
66.0, 73.8, 9.8
xyY
0.441, 0.493, 73.8
10

Y as luminance

The Y in XYZ is deliberately the photopic luminosity function. That single design choice has enormous consequences. It means the second coordinate of every XYZ value directly encodes how bright the stimulus looks. Every contrast calculation in WCAG, every grayscale conversion, every video luminance signal - they all start from Y or a close relative.

Y = 683 ∫ Φ(λ) V(λ) dλ   (in candelas, with ȳ(λ) = V(λ)) Y is luminance, the SI-traceable measure of brightness

In sRGB the Y coefficient is roughly 0.21 R + 0.72 G + 0.07 B - which is why green dominates perceived brightness and pure blue looks so dim despite reaching full digital value. Variants of these coefficients live in Rec.709, Rec.2020, the WCAG relative-luminance formula, and the L* lightness used in CIELAB. They differ slightly because each is tuned to a particular primary set, but they all descend from CIE Y.

Why your blue text fails WCAG contrast even when the hex looks high. #0000ff has linear blue = 1 and zero red/green, but only 7% of luminance comes from the blue channel. The text is perceptually very dark even though "blue is a primary." Y tells you the truth that hex hides.
11

Limitations of XYZ

XYZ is a reference, not a representation of how color looks. Two key shortcomings drove the development of every later color space.

Not perceptually uniform
Equal numerical distances in XYZ do not correspond to equal perceived color differences. CIELAB and CIECAM exist to fix this.
No appearance model
XYZ does not know about surround, adaptation state, luminance level. CIECAM02 / CIECAM16 build appearance on top of XYZ.
Imaginary primaries hide structure
The X, Y, Z axes have no direct perceptual interpretation. L*, a*, b* in CIELAB align with lightness and the two opponent axes.
Single illuminant assumption
XYZ describes one stimulus, but most viewing happens under variable conditions. Chromatic adaptation transforms patch this gap.
Observer-specific
2° and 10° observers disagree slightly. Standardising the observer is a workflow obligation, not a property of XYZ itself.
No HDR awareness
XYZ is conceptually unbounded but practical use assumes a Y around 0-100. HDR pipelines work in extended ranges that need explicit handling.
12

XYZ as the universal hub

Despite its limitations, XYZ is the universal pivot. Every other modern color space is defined by a transform to or from XYZ. ICC profiles store their transforms relative to a profile-connection space that is essentially XYZ at D50. CIELAB is a direct nonlinear function of XYZ. sRGB, Display P3, Rec.2020 are matrix transforms of XYZ. ΔE is computed in CIELAB, which is computed from XYZ.

Interactive 06 · XYZ hub map

Hover any node to see what it requires from XYZ

Each surrounding space is defined as a transform from XYZ. Hover to read the relationship. Without XYZ as a shared frame, none of these spaces could be converted into each other in any well-defined way.

CIE XYZ
Hover any orbiting node to read its relationship to XYZ.
"If two color values cannot be expressed in XYZ relative to a common observer and illuminant, they cannot be compared at all. XYZ is the lingua franca." Editorial summary · CIE colorimetric framework
13

Test your understanding

Six questions on XYZ, the standard observer, and tristimulus integration. Wrong answers come with brief explanations.

Quick check

Loading…
 
Question 1 of 6
14

Continue your journey