Matching and measuring

Most of this diagram cannot be shown

The chromaticity horseshoe is the canonical illustration of colour science, and nearly every printed copy is filled edge to edge with colours the page cannot produce. The honest version marks them, and the marking covers most of the picture.

There is one picture that appears in every introduction to colour science: a rounded, tongue-shaped outline, filled with a smooth wash running from violet at the bottom left through green at the top and round to red at the right. It is the CIE chromaticity diagram, it is eighty years old, and it is the standard way of showing the extent of human colour vision.

Nearly every printed copy of it is showing colours that are not the colours it claims.

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. 1 The same diagram with the dishonest part separated from the honest part. Inside the triangle the colours are correct — each cell computed from its own chromaticity and verified reachable. Outside it nothing is drawn, because there is no value this display can accept that is the colour belonging at those coordinates.

What the diagram is

Every colour a human can see arrives at the eye as a spectrum, and the eye reports three numbers. Discard the overall intensity from those three and two are left, which can be plotted on a plane. That plane is this diagram, and the two coordinates are conventionally called xx and yy.

The curved boundary is the spectral locus: the chromaticities of single wavelengths, from about 380 nm at the bottom to about 700 nm at the right. These are the most saturated stimuli that exist, because a single wavelength is as far from a mixture as it is possible to get. The straight line closing the shape along the bottom is the line of purples, which corresponds to no wavelength at all — purples are mixtures of the two ends of the spectrum and have no place on the locus.

Everything inside the outline is a chromaticity some real light can have. Everything outside it is not a colour at all, merely a pair of numbers.

The problem

A display makes colours by mixing three primaries. Mixing three fixed things in non-negative amounts reaches exactly the triangle whose corners are those three things — that is what mixing means. So the set of chromaticities a screen can produce is a triangle, and the set a person can see is a curved region that strictly contains it.

The triangle is smaller than most people expect. For the sRGB primaries that this page assumes, it covers a bit over a third of the diagram’s area.

That leaves the obvious question of what the ink or the pixels are doing in the other two thirds. The answer is that something was substituted. The usual something is the nearest colour the display can manage, which is a systematic distortion: everything near the boundary gets pulled inward, saturated colours get less saturated, and the gradient that ought to run from vivid to vivid instead flattens out. The spectral locus, the entire reason the diagram has the shape it has, is drawn in colours that are not remotely the colours it is labelled with.

None of this is stated. The caption says “the CIE chromaticity diagram” and the reader takes the colours to mean what they appear to mean.

What it looks like when the substitution is refused

The hero figure above is what the diagram looks like when the machinery is required to check. Every cell is converted from its chromaticity to sRGB and tested; if the result falls outside the range a display can accept, the cell is not drawn at all and the region is hatched.

Hatching rather than a flat grey is deliberate. A solid fill still reads as this region is that colour, which is the confusion being avoided; diagonal lines read as absence, and go on reading that way in greyscale, in print, and for a reader with any form of colour vision deficiency.

The measurement that comes out is that about two thirds of the visible chromaticity plane cannot be shown here at all.

An honest complication: the fraction depends on the brightness

The number above is not a constant, and this is worth dwelling on because it is another thing the usual diagram never mentions.

Chromaticity throws away intensity. To draw a chromaticity, the machinery has to choose a luminance to realise it at, and the choice changes which colours are reachable. A very dark yellow is easy for a display; a very bright one is not. Two diagrams drawn at different luminances have differently sized honest regions, and neither is more correct than the other.

So a diagram of this kind is not merely incomplete — it is a two-dimensional slice through a three-dimensional situation, and the slice was chosen by whoever drew it. Every version of this figure on this site names its luminance in the corner for that reason.

The pure wavelengths, one at a time

The locus is the sharpest case, because every point on it is a single wavelength and not one of them is displayable.

Every pure wavelength, and the fact that none of them can be displayedMonochromatic stimuli from 420 to 660 nm. All 13 are outside the sRGB gamut, so all are hatched; the number under each is how far outside, as a percentage of the channel range. A swatch captioned with a wavelength is never that wavelength.420−8513440−3946460−1374480−201500−95520−65540−28560−8580−7600−96620−187640−238660−261all hatched — none is reachablenumber is the gamut miss, %CIE 1931 2° observer
Fig. 2 Monochromatic stimuli at twenty-nanometre intervals. Every one is hatched, because every one is outside the gamut; the number beneath each is how far outside, as a percentage of the channel range. A swatch captioned with a wavelength is never that wavelength.

This has a practical consequence that turns up constantly. A diagram of a laser, a sodium lamp, a diffraction pattern or a rainbow, captioned with wavelengths and printed with coloured swatches, is showing something other than what it says. The swatches may be a reasonable impression. They are not the stimulus, and the difference is large rather than marginal — the misses in that figure run from twenty to over ninety per cent of the channel range.

Why the primaries are where they are

Given all this, an obvious question is why displays do not simply use better primaries.

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. 3 Three standards on the same diagram. sRGB is the small triangle, Display P3 the middle one, Rec. 2020 the largest. The measured areas nest as expected, and Rec. 2020’s red and green primaries sit on the spectral locus itself — within 0.003 and 0.007 of it.

They can, and increasingly do — Display P3 is now common on laptops and phones. But the trend runs into a hard limit that the diagram makes visible. Rec. 2020, the ultra-high-definition standard, places its red and green primaries on the spectral locus, and the figure above confirms they are within a few thousandths of it. A primary on the locus is monochromatic, which means a Rec. 2020 display would need three lasers. Some do. Most cannot, and every one that cannot is showing a smaller gamut than the standard it claims.

Extending the triangle has a cost even when it works. The same number of code values now has to cover a larger region, so each step is a bigger jump; and any content authored for the smaller gamut is wrong on the larger one unless something explicitly converts it. Wider is not free.

What clipping actually does

It is worth being precise about the substitution, because “clipped” sounds like a small trim and it is not.

A colour arrives as three linear-light numbers, one per primary. Reachable means all three fall between zero and one. An unreachable colour has at least one that does not, and the failure is almost always a negative channel rather than one above one — the display is being asked for less than no red, which is a request to remove light that was never there.

Clamping that negative to zero adds light the colour did not have. The result is less saturated, and shifted in hue by an amount depending on which channel failed and by how much. Near the spectral locus the miss runs to most of the channel range, so what appears in place of a pure cyan is not a slightly duller cyan but a substantially different colour with the same name.

A constant-lightness hue circle at chroma 0.13, with the unreachable arcs hatchedThirty-six hues at one lightness and one chroma. 33 of 36 are inside the sRGB gamut; the rest are hatched. The gaps are not evenly spaced, because the gamut is a triangle in a space where a constant-chroma circle is a circle.chroma 0.13, lightness 0.7233 of 36 reachablehatched arcs cannot be shownsRGB
Fig. 4 A circle of thirty-six hues at one lightness and one chroma. Twenty-two are reachable and fourteen are not, and the unreachable arcs are not evenly spaced — the gamut is a triangle, so the reachable set bulges toward the primaries and pinches between them. A palette generated by walking a hue circle at constant chroma silently loses those arcs.

That figure is the practical version of the problem, and it catches people who never go near a chromaticity diagram. Generating a palette by stepping around a hue circle at fixed lightness and chroma is a standard and sensible-looking procedure. Fourteen of these thirty-six steps do not exist, and whatever tool produced them returned something else without comment.

What the light was, before any of this

The diagram deals in chromaticities, which are already two steps removed from anything physical. What actually arrives is a spectrum.

Illuminant D65 and the white it producesThe spectral power distribution of D65 across the visible range, and the colour a perfect white reflector takes under it: chromaticity (0.3127, 0.3290).400450500550600650700wavelength / nmD65x 0.3127y 0.3290CIE D65 — average daylight, and the white point sRGB assumesCIE 1931 2° observer
Fig. 5 The spectral power distribution of D65, the daylight illuminant sRGB assumes, with the white it produces. The curve has structure across the whole visible range; the white beside it is three numbers. Everything between those two pictures is discarded information.

Keeping that in view prevents a particular error. A point on the chromaticity diagram does not correspond to a light — it corresponds to an enormous family of lights, all of which happen to produce the same three cone responses. Two spectra can be wildly different and land on the same point, which is not a curiosity but the basis of all colour reproduction, since it is the only reason three primaries can stand in for anything at all.

What the diagram is still good for

None of this makes the diagram useless. Two things it does well:

It shows what mixing does. Mix two lights and the result lies on the straight line between them, at a position set by their relative intensities. That is a genuine geometric fact and the diagram displays it perfectly — which is why the reachable region really is a triangle, and why no arrangement of three primaries can ever reach a curved boundary.

It shows what cannot be done. The gap between the triangle and the curve is not an engineering problem awaiting a solution. It is a consequence of using three fixed primaries, and it closes only in the limit of primaries that are themselves monochromatic.

What the diagram does badly is anything to do with appearance, and the temptation to read it that way is strong, because it is a picture full of colours. Distances on it do not correspond to perceived differences, and the position of a colour on it says nothing about how light or dark it looks, since that information was discarded to make the plot two-dimensional.

MacAdam's discrimination ellipses, drawn 10 times actual sizeTwenty-five ellipses of colours indistinguishable from their centres. They are drawn at 10× because at true scale most are thinner than a line. Their areas vary by a factor of 74, which is the whole result: a step of the same size in xy means very different things in different places.0.00.20.40.60.80.00.20.40.60.8xyellipses at 10× scaleCIE 1931 2° observer
Fig. 6 MacAdam’s discrimination ellipses on the same axes, drawn ten times actual size because at true scale most are thinner than a line. Each encloses the colours indistinguishable from its centre. Their areas vary by a factor of eighty, so a step of a given size in xx and yy can be invisible in one place and obvious in another.

Those ellipses are the reason every subsequent colour space exists. If the diagram were perceptually uniform they would all be circles of the same size, and the fact that they are neither is not a small correction — the largest is roughly eighty times the area of the smallest. Reading distances off this diagram is reading a map whose scale changes from place to place, and changes by two orders of magnitude.

There is a related trap in the geometry. The green region occupies an enormous share of the diagram’s area, which invites the conclusion that human vision is somehow mostly green. It is not; the area is an artefact of the projection, and it is precisely where the ellipses are largest, meaning that huge region contains rather few distinguishable colours.

What was computed here

Every cell of every diagram on this page was computed rather than sampled from an image. The chain runs: chromaticity, to XYZ at a stated luminance, to linear RGB through the matrix derived from the sRGB primaries, to a test of whether all three channels fall in [0,1][0, 1], and only then to a fill. Cells failing the test are not drawn.

The machinery is checked in both directions, which matters more than the forward direction working. The sRGB primaries themselves must test as reachable, and a monochromatic 520 nm stimulus must test as unreachable and must miss by a wide margin — it misses by 0.93 of the channel range. A gamut test that quietly returned “yes” to everything would pass every other check on this site while making its entire premise void.

The habit worth taking away

Whenever a figure shows colours as data — a chromaticity diagram, a spectrum, a wavelength scale, a gamut comparison — the question worth asking is whether the colours shown are the colours meant, or the nearest the medium could manage.

Usually it is the second, and usually nothing says so.

The rule this site follows

Compute the colour, test whether the display can show it, and mark it when it cannot.

What the pictures cannot show

The obvious one: this page cannot show the reader what is missing. That is the point, and it is also the limitation. The hatched region is an absence, and no amount of design can turn an absence into an impression of vivid cyan.

The second is that the diagram assumes a specific observer. The 1931 functions are an average over seventeen people, and a different observer would put the boundary in a slightly different place. The horseshoe is not a property of light; it is a property of a particular tabulated model of human vision.

The third is the display itself. Everything here assumes sRGB primaries and the standard transfer function. A reader on a wide-gamut screen with correct colour management is seeing a slightly larger honest region than the figures claim, and the site has a probe for that — but nothing on this page can tell which case applies.

Who found it, and when

The 1931 CIE system was built to solve a specific industrial problem: given two lights, predict whether they will match. It does that well, and the diagram is a byproduct of the coordinate system chosen to make the arithmetic convenient.

David MacAdam’s work in the 1930s and 1940s established that the diagram is badly non-uniform, and the CIE has been issuing replacements ever since — the 1960 UCS diagram, the 1976 u′v′ diagram, CIELAB, and more recently spaces like Oklab. Every one of them is an attempt to fix a defect in the original that was understood almost immediately.

The filled-horseshoe illustration, meanwhile, has survived unchanged for ninety years, because it is beautiful and because nobody checks.

Where this goes next

The natural next step is why the eye reduces everything to three numbers in the first place, since the entire diagram is a consequence of that. From the practical direction, what a gamut costs takes up the engineering question this essay only gestures at. And a hex code is not a colour deals with the everyday version of the same confusion, which is more likely to bite anyone actually working with colour.