What the eye does

Why colour is exactly three-dimensional

Matching every wavelength with three primaries requires, for some wavelengths, a negative amount of one of them. That physical awkwardness is why the colour-matching functions were transformed into XYZ, and why the horseshoe is curved.

The colour-matching experiment is simple enough to describe in a sentence. A field is split in two; one half is lit with a single wavelength; the observer adjusts the intensities of three fixed primary lights on the other half until the two halves look identical. Repeat for every wavelength across the spectrum, and the result is three curves — how much of each primary is needed, wavelength by wavelength.

For a substantial part of the spectrum, the experiment fails. No amount of the three primaries matches the test light.

The CIE 1931 colour-matching functionsThe three functions that turn a spectrum into three numbers. They are all positive, which is why XYZ exists — the RGB functions they were derived from are not. ȳ is by construction the luminous efficiency function, which is why luminance comes out of Y.400450500550600650700wavelength / nmȳȳ is the luminous efficiency functionCIE 1931 2° observer
Fig. 1 The CIE 1931 colour-matching functions. All three are positive everywhere, which is the point of them and is not how they were measured — they are a transformation of RGB functions that go conspicuously negative, and that transformation is the reason this system exists.

What the observer does when the match is impossible

The failure has a fix, and the fix is what makes the subject interesting.

When no mixture of the three primaries matches the test light, the observer moves one primary to the other side — adding it to the half of the field containing the test wavelength rather than the half containing the mixture. Once a match is reached, the amount added there is recorded as a negative quantity.

That is not a bookkeeping trick. It is a statement about what the equation means. The observer has established

test+rR=gG+bB\text{test} + r\,\mathbf{R} = g\,\mathbf{G} + b\,\mathbf{B}

which rearranges to the matching equation with r-r in it. The algebra is consistent; the physical realisation is not, because there is no such thing as a negative quantity of light.

Why the shortfall happens

Any single primary excites more than one cone class, because the cone sensitivity curves overlap heavily — the L and M peaks are only twenty-five nanometres apart. There is no way to stimulate the M cone alone, because anything that excites M excites L as well.

A pure spectral cyan near 490 nm excites M and S strongly and L rather little. Any mixture of red, green and blue primaries that produces enough M inevitably drags L along with it, so the mixture is always less saturated than the test light. Subtracting the excess L means adding red to the test side, which is exactly what the observer does.

So the negative lobes are a direct consequence of the receptors overlapping, and any three real primaries have them somewhere. Choosing better primaries moves the negative region; it never removes it.

The geometric statement

This is the same fact as the gamut triangle, seen from the other end.

Mixing primaries in non-negative amounts reaches the triangle they span. The spectral locus is convex and curved, so it lies partly outside any triangle whose corners are on or inside it. A wavelength outside the triangle needs a negative coefficient — the coefficients of a point are its barycentric coordinates with respect to the triangle, and points outside have at least one negative.

The curvature of the locus therefore is the negative lobes, and both are consequences of the cone curves overlapping. A hypothetical eye with three non-overlapping receptors would have a triangular locus, no negative lobes, and a display that could reproduce every visible colour with three primaries.

What XYZ is for

Negative numbers were an obstacle in 1931 in a way that is easy to forget. The calculations were done by hand, by people, on paper. Sign errors are the commonest arithmetic mistake there is, and a system requiring the multiplication of tables containing negatives was a system that would produce wrong answers in industrial practice.

The CIE’s response was to change coordinates. There is nothing sacred about the primaries used in the experiment; any invertible linear transformation of the three matching functions describes the same observer, since the information is the same. So they chose a transformation making all three functions non-negative everywhere.

The cost is that the new primaries are not real. X, Y and Z are outside the spectral locus, which means they are not lights and cannot be lights; they are colours more saturated than any wavelength. They are sometimes called imaginary primaries, which is precise: the same sense in which 1\sqrt{-1} is imaginary, and useful for the same reason.

Two further conveniences were built into the choice at the same time:

  • yˉ\bar{y} was made identical to the photopic luminous efficiency function V(λ)V(\lambda), so that Y is luminance. This is why luminance falls out of a colour calculation without extra work, and why the three functions cannot be permuted.
  • The white point of an equal-energy spectrum was placed at x=y=1/3x = y = 1/3 exactly, which is a definition and not an approximation. It is also the cheapest available check on a table of matching functions: get the relative scaling of the three wrong and equal-energy white moves off that point immediately.
Illuminant E and the white it producesThe spectral power distribution of E across the visible range, and the colour a perfect white reflector takes under it: chromaticity (0.3333, 0.3333).400450500550600650700wavelength / nmEx 0.3333y 0.3333equal energy — not a real light, but exactly (1/3, 1/3) by constructionCIE 1931 2° observer
Fig. 2 Equal-energy illuminant E — flat by construction, not a real light, and the stimulus that lands at exactly one third, one third. Any error in the relative scaling of the three matching functions shows up here before it shows up anywhere else.

What this does not explain

Trichromacy explains why the space has three dimensions. It says nothing about which three dimensions the visual system actually uses downstream, and the answer there is not L, M and S.

The retina recombines the cone signals almost immediately into opponent channels: roughly light-versus-dark, red-versus-green, and blue-versus-yellow. This is why no colour is simultaneously reddish and greenish, why the afterimage of red is green, and why the four unique hues — red, green, yellow, blue — feel more fundamental than orange or turquoise despite having no special status in the cone responses.

Opponent processing and trichromacy were treated as rival theories for most of the nineteenth century, Hering against Helmholtz, and the resolution is that both are right at different stages. Three receptors, then three opponent channels computed from them. The dimensionality survives the recombination; the axes do not.

The count in other species

The three cone fundamentalsLong, medium and short wavelength cones, derived from the colour-matching functions. The L and M peaks are only 25 nm apart — the eye spends two of its three receptors on nearly the same part of the spectrum, which is why red-green deficiency is by far the commonest kind and why the names "red" and "green" cones are misleading.25 nm400450500550600650700wavelength / nmSMLnot red, green and blueCIE 1931 2° observer
Fig. 3 The three human cone fundamentals. The near-coincidence of L and M is a consequence of their recent common ancestry — the two pigments are a duplicated gene, which is also why red-green deficiency is the commonest kind.

Most placental mammals are dichromats, having lost two of the four cone classes present in early vertebrates during a long nocturnal period. Old-world primates re-evolved a third by duplicating the long-wavelength gene, which is why the L and M curves sit almost on top of one another — they are recent copies rather than an evolved spread.

Birds, reptiles and many fish retained four, frequently including an ultraviolet class. Their colour space is four-dimensional, their matching experiments would require four primaries, and their metamers are not the same as a human observer’s. A pair of surfaces matching for a human is generally distinguishable to a bird, which is worth remembering whenever “the colour of” some animal marking is discussed.

The mantis shrimp is often cited as having twelve or sixteen receptor classes and therefore extraordinary colour vision. The behavioural evidence suggests the opposite: it appears to discriminate colours worse than a human, and the many receptors are thought to support fast recognition rather than fine discrimination. Dimensionality of the receptor space and quality of colour vision are not the same quantity.

The consequence for reproduction

The negative lobes have a direct engineering translation, and it is the whole story of why displays cannot show everything.

The CIE 1931 chromaticity diagram with its unreachable region markedThe spectral locus encloses every chromaticity a human eye can see. Cells inside the sRGB triangle are drawn in their own colour; the 85 per cent outside it are hatched, because no value this display accepts is the colour belonging there.0.00.20.40.60.80.00.20.40.60.8xyD65460480500520540560580600620hatched: outside sRGB15% of the visible area is reachableat luminance Y = 0.55CIE 1931 2° observer
Fig. 4 The reachable triangle inside the visible region. The hatched area is exactly the set of colours whose match would require a negative amount of one primary — the negative lobes, drawn as a region rather than as a curve.

The two pictures are the same fact. A chromaticity outside the triangle is one whose barycentric coordinates include a negative, and a negative coordinate means the matching experiment failed and the primary had to be moved to the other side of the field. A display has no other side of the field, so it clips.

sRGB, Display P3 and Rec. 2020 compared on the chromaticity diagramThree nested triangles inside the horseshoe. sRGB covers 74 per cent of the area P3 covers. Rec. 2020's red and green primaries sit on the spectral locus itself, within 0.000 and 0.002 of it, meaning they are monochromatic.0.00.20.40.60.80.00.20.40.60.8xysRGBP3Rec. 2020areas are diagram areas, not perceptualCIE 1931 2° observer
Fig. 5 Wider primaries shrink the problem without solving it. Rec. 2020 pushes its red and green onto the spectral locus itself, which is as far as three primaries can go — and even that leaves the region between the primaries unreachable, because a triangle inscribed in a convex curve never fills it.

The limit is geometric rather than technological. Three points span a triangle; the locus is curved; a triangle inscribed in a convex curve touches it at three points and misses everywhere else. More primaries would help — four, five, six-primary displays exist and reach a polygon rather than a triangle — and no finite number reaches the curve.

What the dimension count does not settle

Two things follow from trichromacy and two things do not, and the pairs get confused.

It does follow that three numbers describe a stimulus completely, and that three primaries suffice for reproduction. Both are strong claims and both are true.

It does not follow that the space is naturally divided into three hues, and it does not follow that any particular three colours are fundamental. “Red, green and blue are the primary colours” is a statement about a convenient choice of basis, not about vision. The same observer is described equally well by XYZ, by LMS, by the RGB primaries of the original matching experiments, or by any other invertible transformation. Arguing about which triple is real is arguing about coordinates.

Nor does it follow that the perceptual axes are the receptor axes. The opponent recombination described above means the axes people actually experience — light-dark, red-green, blue-yellow — are computed from the cone signals rather than being them, which is why the traditional artist’s primaries of red, yellow and blue are not nonsense either. They are a reasonable basis for a subtractive mixture with a different set of constraints, and the perennial argument about whether the primaries are RGB or RYB is a confusion between two different questions.

The experiment as it was actually run

The description at the top compresses a piece of laboratory work that took years, and some of the details are load-bearing.

Wright and Guild used a bipartite field of about two degrees — a patch roughly the size of a thumbnail at arm’s length — because the fovea’s cone mosaic is not uniform beyond that, and because the macular pigment covering the central retina absorbs strongly in the blue. That choice is why the 1931 observer is the two-degree observer, and why a second, ten-degree observer was needed later for the larger fields that occur in practical colour matching.

The primaries were monochromatic: Wright used 650, 530 and 460 nm, Guild used broadband filters and converted. Both sets were transformed to a common basis before averaging, and the transformation required knowing each observer’s own primaries precisely — which is where much of the experimental care went.

The matches were also made at a fixed luminance and in a dark surround, both of which matter. A match made against one surround is not guaranteed to hold against another, and that limitation propagates into everything built on the data.

Four standard illuminants, and how little they have in commonSpectral power distributions for E, D65, on one scale. Illuminant A rises steeply toward the red; the daylight illuminants carry the atmosphere's absorption structure; E is flat by definition. All four are ordinarily called white.400450500550600650700wavelength / nmE0.333, 0.333D650.313, 0.329normalised to 100 at 560 nmCIE 1931 2° observer
Fig. 6 Two of the reference stimuli the system is anchored to. Equal-energy E lands at exactly one third, one third by construction; D65 lands at the white point sRGB assumes. Both are used on this site as checks that the matching-function table has not drifted.

Why the transformation was not unique

The CIE chose one transformation from RGB to XYZ, and it is worth being clear that many others would have worked.

The requirements were: all three functions non-negative everywhere, yˉ\bar{y} equal to the luminous efficiency function, equal-energy white at one third, and the resulting primaries as close to the locus as the non-negativity permits so that little of the space is wasted. Those constraints pin the transformation nearly but not entirely, and the final choice involved judgement.

That is worth knowing because it puts XYZ in the right category. It is not a discovery about vision. It is a coordinate system chosen in 1931 by a committee, optimised for hand computation, and retained since because everything else was built on top of it. The observer data underneath it is empirical; the axes are a convention.

Later systems have made different choices from the same data — CIELAB, CIELUV, and more recently Oklab are all transformations aimed at perceptual uniformity rather than computational convenience, which was not a design goal in 1931 and turned out to matter more.

What was computed here

The matching functions shown are tabulated data — they are measurements of people, and this site quotes measurements. Everything downstream of them is computed.

The checks that matter are the two mentioned above. Equal-energy illuminant must land at (1/3,1/3)(1/3, 1/3), and the computed value is (0.33333,0.33333)(0.33333, 0.33333) with a maximum error of 2.1×1062.1 \times 10^{-6}. D65 must land at (0.3127,0.3290)(0.3127, 0.3290), and it does, to 1.3×1051.3 \times 10^{-5}. Both are definitional targets rather than approximations, so any drift means the table is wrong rather than the tolerance being tight.

A third check ties the two halves of the site together. The sRGB primaries are converted to XYZ through a matrix derived independently from their chromaticities, and the white point that falls out must agree with the one the spectral integration produces from the D65 spectrum. Those two routes share no code, and requiring them to agree is what would catch an error in either.

What the pictures cannot show

The negative lobes are not drawn here, and cannot be usefully drawn as colours, since a negative amount of a primary has no appearance. They can be plotted as a curve dipping below an axis, which is a graph of a coefficient rather than a picture of a colour.

More fundamentally, the imaginary primaries cannot be shown at all. X, Y and Z lie outside the locus, so they are not merely outside the display gamut — they are outside the set of things light can do. Every figure on this site that says “outside the gamut” is making a much weaker claim than that.

Who found it, and when

Newton established in the 1660s that white light is composite and that spectral colours are not further decomposable. Young proposed three receptors in 1802 and Helmholtz developed it. Maxwell ran quantitative matching experiments in the 1850s with spinning discs, and understood that the results implied a three-dimensional space.

The negative-coefficient problem was familiar to everyone doing the experiment through the nineteenth century. The CIE’s 1931 meeting adopted the XYZ transformation, based on matching data from William Wright and John Guild, collected from a total of seventeen observers. That system is still in use, essentially unmodified, and every colour specification in industrial practice descends from it.

Where this goes next

The consequence for reproduction is what a gamut costs, which is the negative-lobe problem in its engineering form. The provenance of the functions themselves is seventeen observers in 1931. And for what happens when the receptors are not three, simulating what cannot be simulated takes up the dichromatic case.