Colour Science & Perception

About

What this site is, why every swatch on it is computed from a spectrum, and why the page it is printed on is deliberately grey.

This is a growing collection of illustrated essays about colour and how it is seen. Each takes a single idea and draws it until the argument is visible — and this is the one subject where the page is displayed on the very apparatus under discussion, which is both the opportunity and the whole difficulty.

No figure contains a hex code

A colour on this site begins as a spectral power distribution: a function of wavelength, either an illuminant, a measured reflectance under an illuminant, or a constructed spectrum. It is integrated against the colour-matching functions of a named observer to give CIE XYZ, converted into whatever space the figure works in, and only then written into the drawing. Nothing is eyedroppered, and nothing is a value recalled from a table.

This matters more in colour than it does in most subjects, because a hex code on its own does not identify a colour at all. It identifies three numbers whose meaning depends on a colour space, a transfer function, a white point and a display. Naming the spectrum and the observer is the only way to say what was actually meant.

Everything outside the gamut is marked

Most of the colours a person can see cannot be shown on this page. The canonical illustration of that fact — the CIE chromaticity diagram — is usually printed filled edge to edge with colour, which is impossible: a screen reaches a triangle covering roughly a third of the CIE 1931 diagram's area. Everything beyond it, including the entire spectral boundary that the diagram exists to plot, has been clipped or mapped to something reachable, and the caption almost never says so.

That fraction is a property of the plane it is measured on rather than of the eye, which this collection quoted for a year before measuring it: the same triangle inside the same locus covers between 8.5 and 38.4 per cent of the diagram across the twelve coordinate systems the discipline has published. The invariant form of the question counts stimuli instead of area, and has two answers — about 92 per cent of the surfaces this site constructs are reachable, and none of the pure wavelengths is.

Here the machinery asks, for every colour it is about to draw, whether the display can reach it. If it cannot, the figure marks the region rather than filling it with the nearest available lie. That is the single most visible difference between the diagrams on this site and the ones in print, and the hatching covers about two thirds of the picture. Which cells are hatched does not depend on the diagram — membership of a gamut is a fact about tristimulus values — and how much of the frame they occupy does.

The observer's own coordinates are a choice

A colour match is an equality between two triples of integrals, so applying any nonsingular 3×3 to the colour-matching functions leaves every match exactly where it was. Matching data of any quantity and any precision therefore leave the observer's three curves undetermined up to nine numbers, and every table of cone fundamentals, every adaptation transform and every lightness–chroma space is a choice among them made by somebody for some purpose.

What closes the freedom is a different experiment — the three dichromat confusion points supply six of the nine, and a von Kries gain turns out to be exactly blind to the other three. So the receptors are determined rather than fitted, and they are not where either of the two jobs this collection measures would put them. The basis that minimises what an adapted observer is left with after a white balance is further from the receptors than any published transform; the basis that makes the discrimination ellipses roundest is nearer to them than any published transform. No basis is good at both, and the transforms in daily use are unstated positions on a disagreement nobody has written down.

Those three quoted confusion points are the position this collection is most exposed on, and the exposure is now measured rather than acknowledged. Propagated across a population of eyes — five measurements that differ between people, each with a reported spread — the same construction leaves between 1.22 and 2.25 ΔE00 after a gain, where the single observer whose points are published leaves 1.65. That spread is wider than the entire range of the published transforms it is being compared against, so the receptor basis costs seventy per cent turns out to be a sentence about a person as much as about a construction.

And an objective's shape decides more than its value. The second-derivative matrix of either job has rank exactly six rather than nine, so the invariance above is measurable as a rank; its six real curvatures span a factor of nearly nine hundred; and what a constraint costs is that curvature in the direction the constraint points, not how many parameters it removes. Three measurements in this collection turned out to be maxima taken over samples — forty-eight points round an ellipse, twenty-four directions out of an optimum, fourteen changes of light off a list — and all three were short, in the same direction, by amounts that grow with the answer. Each has been replaced by arithmetic that needs no sample, and the numbers those measurements produced have been corrected.

"These two patches are identical" is an assertion

It is the most repeated and least checkable sentence in visual perception. Simultaneous contrast, White's illusion, the Adelson checkerboard, the Cornsweet edge — the entire rhetorical force of each figure rests on an identity the reader cannot confirm by looking, because the whole point is that it does not look true.

Every such claim here is a call to assertSame, which compares the two computed values and throws. The caption therefore states a fact about the drawing rather than a promise from the author, and a figure whose two patches ever drift apart stops the build.

What else is checked

Why the page is grey

Deliberately, and for a reason from the subject rather than from taste. A patch of colour has no fixed appearance: it shifts with whatever surrounds it. Coloured page furniture would bias every swatch on every page, in a direction varying with where the swatch happened to sit in the layout. So the paper and the ink here are exactly neutral — equal in all three channels, checked in the gate — and the only chroma on a page is chroma some figure computed.

Where the models stop

Three places, and the first is the one that causes the most trouble in practice.

Matching is not appearance. CIE XYZ predicts when two lights will look the same under identical viewing conditions. It was never a model of how anything looks. Two patches with identical XYZ in different surrounds can look completely different, and most of the confusion in applied colour comes from treating a matching model as an appearance model.

The standard observer is not a person. The 1931 functions are an average over seventeen observers, they are known to be wrong in the blue, and real observers vary by more than most people expect. Where an essay says "the observer" it means a specific tabulated function, named in the figure.

Nothing here knows what display this is. Every appearance claim is conditional on an uncalibrated screen of unknown gamut in unknown ambient light. The figures state their assumptions — sRGB primaries, D65 white, the standard transfer function — and where a claim would collapse if those were wrong, the essay says which claim and how.

On being wrong

Corrections are welcome and will be made. A swatch with a wrong caption looks exactly like one with a right caption, which is the entire argument for computing the caption.