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.

Assumes Three numbers.

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.

How much of the spectrum fails

A substantial part is measurable, and the part turns out to be a band with edges.

Transforming the 1931 functions into a basis of monochromatic primaries at 700, 545 and 435 nanometres — Wright’s arrangement, to the nearest grid point — and asking where a coefficient comes out negative: the band runs from 440 to 540 nanometres, which is 34 per cent of the range from 400 to 700, and the negative is always the red one.

The band has sharp edges. Below 440 and above 540 every coefficient is positive to within a rounding, so the experiment succeeds directly. Between them it never does. A third of the visible spectrum cannot be matched by any mixture of those three lights, and the third is contiguous rather than scattered.

And the negatives are not small. At 445 nanometres the three coefficients are −1.710, 0.019 and 1.098. The observer has to add more than half as much red again to the test side as the largest amount of any primary going onto the mixture side. Correction is the wrong shape of word for that: the red primary is the dominant term in the equation, and it is on the other side of it.

Which is the sense in which the negativity is structural rather than awkward. It is not that three real primaries nearly span the visible colours and fall a little short at the edges. It is that across a third of the spectrum the nearest thing to a match is dominated by a primary that has had to be taken out of the mixture altogether.

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.

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

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 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 diagram. Three 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.
Fig. 2 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.

Wider primaries and a different observer are the two things that can be varied without leaving the diagram, and neither of them adds a dimension.

sRGB, Display P3 and Rec. 2020 compared on the chromaticity diagram. Three 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.006 of it, meaning they are monochromatic.
Fig. 3 The same three sets of primaries under the ten-degree observer. Every triangle moves and every one of them is still a triangle, because three primaries mixed additively can only ever reach the convex hull of three points.
sRGB, Display P3 and Rec. 2020 compared on the chromaticity diagram. Three 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.
Fig. 4 And at a lower luminance factor, where the reachable region itself is smaller. The dimension of the space is not what changes with any of these; what changes is which part of it a device can get to.

Two more corners of the same square are worth drawing, because between them they say that the dimension of the space is not what any of these arguments is capable of touching.

sRGB, Display P3 and Rec. 2020 compared on the chromaticity diagram. Three 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.006 of it, meaning they are monochromatic.
Fig. 5 The ten-degree observer at a low luminance factor. Every triangle has moved and every one is still a triangle, because three primaries mixed additively reach the convex hull of three points and nothing else.

Near the top of the luminance range almost nothing is reachable by anything at all, and that is the last of the arguments which could in principle have added a dimension to the space and does not.

sRGB, Display P3 and Rec. 2020 compared on the chromaticity diagram. Three 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.
Fig. 6 And near the top of the range, where almost nothing is reachable at all. The region shrinks, the triangles shrink with it, and the number of coordinates it takes to say where anything is stays at two.

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.

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.

Three dimensions, and not three equal ones

The dimension count is exact and it is also, on its own, misleading about how much each dimension carries.

Take a family of natural reflectances, run them through the cone fundamentals, and look at how the three responses vary together. The L and M responses correlate at 0.999. Knowing one is very nearly knowing the other, because the two fundamentals overlap so heavily that almost nothing in the natural world separates them. Transmitting both down the optic nerve as independent quantities would spend two channels on one signal.

What the retina does instead is send a sum and two differences, and the differences are not equally worth sending. Decorrelating the cone responses — asking what three axes would carry independent information — produces an achromatic channel carrying some 97% of the variance, a blue-yellow channel carrying under 3%, and a red-green channel carrying about one part in ten thousand.

That last number is the surprising one, because red-green is the channel everybody thinks of as the colour channel. It is the one colour blindness is usually about, the one CIELAB puts first, the one the word “colour” in ordinary speech mostly means. Across natural spectra it is the axis carrying least, by three orders of magnitude, and for the same reason it exists at all: L and M are nearly the same measurement, so their difference is nearly nothing, and nearly nothing is still worth extracting when the alternative is not seeing fruit.

The space is three-dimensional. Its dimensions are not remotely comparable in size, and no picture drawn on equal axes will suggest otherwise.

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.

What this makes readable

Essays that name this one as a prerequisite.

Named alongside this one

Essays reaching for the same objects. Nobody chose these; they are what the index of named objects makes visible.

What links here

The 8 essays that link to this one and share the most of its objects, of 13 that link here.

The objects this essay names

Each one links to every other essay that touches it.

Colour-matching functionsGamutImaginary primariesNegative primariesPrimariesSpectral locusWhite pointXYZ