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.
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.
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 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.
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 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.
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.
Probe the three matching functions
The curves are x̄ (red), ȳ (green - identical to V(λ) by design), and z̄ (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̄ 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
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.
Tristimulus integration
Now we can write the full operational definition. For a self-luminous stimulus Φ(λ) - measured in watts per nanometer - the tristimulus values are
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.
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
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.
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.
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.
- x
- 0.330
- y
- 0.330
- z (= 1 - x - y)
- 0.340
- Approximate appearance
- #ffffff
- Notable point
- D65 white point neighborhood
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.
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."
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.
- 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
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:
[ 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.
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
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.
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.
#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.
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.
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.
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.
Test your understanding
Six questions on XYZ, the standard observer, and tristimulus integration. Wrong answers come with brief explanations.
Quick check
Continue your journey
White Points and Chromatic Adaptation
Adapting XYZ between illuminant white points - von Kries and Bradford.
Foundations · 01What Color Is and How Humans See It
The cornerstone explainer connecting light, surface, eye, brain, and standards.
Foundations · 02History of Color Science from Newton to Hering
How CIE 1931 emerged from three centuries of accumulating color research.
Physics · 04Spectral Power Distributions and Why RGB Is Not Enough
The full spectrum that XYZ integrates against - and why you sometimes need it back.
Vision · 05Human Color Vision: Cones, Opponent Signals, and the Brain
The biology XYZ idealizes into mathematics.
Vision · 07Color Constancy, Adaptation, and Why Colors Change with Context
The phenomenon XYZ does not model - solved by appearance models built on top.
Colorimetry · 09CIELAB and LCH Explained
The perceptually uniform space that takes XYZ as its starting point.
Colorimetry · 10Chromaticity Diagrams Without the Intimidation
How to read the xy horseshoe, the spectral locus, and the line of purples.