Difference and uniformity

How far apart are two colours

ΔE is meant to be a distance with the property that the same number means the same perceived difference everywhere. Three successive formulae have tried, they disagree with each other by more than a just-noticeable difference, and the disagreement decides real matching questions.

The useful thing to be able to say about two colours is how different they are. Industrial colour control needs it — is this batch within tolerance? — and so does anything that has to decide whether two things will be confused.

The quantity is called ΔE, and there are at least three of them.

Three colour-difference formulae, disagreeingΔE76, ΔE94 and ΔE2000 for the same nine pairs of colours. The largest disagreement between ΔE76 and ΔE2000 here is 26.6 units — larger than the threshold usually quoted for a just-noticeable difference, so the choice of formula can decide whether two colours count as matching.ΔE76ΔE94ΔE2000same pairs, three answersCIELAB, D65
Fig. 1 ΔE76, ΔE94 and ΔE2000 evaluated on the same nine pairs. The largest disagreement between the oldest and newest here is more than four units — larger than the threshold usually quoted for a just-noticeable difference, so the choice of formula can decide whether a pair counts as matching.

The 1976 formula, and why it was not enough

CIELAB was designed so that Euclidean distance in it would be perceptually meaningful. If that had worked, ΔE would be

ΔE76=(ΔL)2+(Δa)2+(Δb)2\Delta E_{76} = \sqrt{(\Delta L^*)^2 + (\Delta a^*)^2 + (\Delta b^*)^2}

and there would be nothing more to say. The formula is simple, it is symmetric, it obeys the triangle inequality, and it is a genuine metric in the mathematical sense.

It does not work well enough. Transforming MacAdam’s ellipses into CIELAB shows why: the space equalised the size of the discrimination contours far better than it made them round, leaving a mean anisotropy of about 3.4. A step of a given size still means substantially different things depending on direction and position — particularly in the saturated regions, where CIELAB systematically overstates differences.

ΔE94: weighting by chroma

The 1994 formula keeps the space and weights the components:

ΔE94=(ΔLkLSL)2+(ΔCkCSC)2+(ΔHkHSH)2\Delta E_{94} = \sqrt{\left(\frac{\Delta L}{k_L S_L}\right)^2 + \left(\frac{\Delta C}{k_C S_C}\right)^2 + \left(\frac{\Delta H}{k_H S_H}\right)^2}

with SCS_C and SHS_H growing linearly with chroma. The effect is that differences between saturated colours are discounted relative to differences between muted ones, which is the direction the data demands.

The kk terms are application-dependent parameters — textiles use different values from graphic arts — which is the first sign of something significant. A “perceptual distance” that needs to be told what industry it is being used in is not purely perceptual.

ΔE2000: and this is where it gets ugly

CIEDE2000 adds three more corrections on top:

  • A chroma-dependent rotation term RTR_T, which handles the blue region specifically. CIELAB’s worst-known failure is that blues shift toward purple as chroma changes, so the discrimination ellipses there are rotated relative to the axes, and a term is needed to account for it.
  • A lightness weighting SLS_L that varies with lightness, since discrimination is poorer at the extremes than in the middle.
  • A correction to aa^* applied before anything else, which improves behaviour for near-neutral colours.

The formula runs to about twenty lines. It is not a metric — it violates the triangle inequality — and it has discontinuities in its derivatives. It is also, on the data it was fitted to, clearly the best of the three.

The trajectory is worth noticing. Each formula is a patch on the space rather than a fix to it, and the patches accumulate. By 2001 the community had a very accurate empirical fit and a space that was still not uniform.

What a ΔE value licenses

Three claims are commonly made, and only the first is safe.

“ΔE around 1 is roughly a just-noticeable difference.” Approximately true for ΔE2000 under controlled side-by-side viewing. This is the number’s design point.

“ΔE 3 is three times as different as ΔE 1.” Not reliable. The formulae are fitted to threshold and near-threshold data, and their behaviour at large differences is an extrapolation. Two pairs at ΔE 20 are not usefully described as differing by the same amount.

“ΔE under 2 means nobody will notice.” Depends entirely on the arrangement. Two patches sharing an edge are compared far more sensitively than two separated by white space, and two seen at different times are compared very poorly indeed. The published thresholds assume side-by-side comparison, and the viewing situation is not part of the formula.

That last one causes the most trouble in practice. A gradient with a ΔE 1 step between adjacent bands will band visibly, because adjacent comparison is the most sensitive case there is. The same step between two elements at opposite corners of a page is invisible.

Four colour spaces ranked by how uniform they actually areThe spread — largest ellipse over smallest, after transformation — for each space. Raw chromaticity is worst at 10.4. The three perceptual spaces are all far better and close to one another, with CIELUV at 2.21 and Oklab at 2.57 — a smaller gap than the usual advocacy suggests.CIE 1931 xy10.42aniso 2.95CIELAB3.24aniso 3.42CIELUV2.21aniso 2.37Oklab2.57aniso 2.27spread: largest JND ellipse ÷ smallest (1 is perfect)measured, not quotedat Y = 0.4
Fig. 2 The underlying problem, measured. Even the best-performing space leaves a residual non-uniformity of about a factor of two, and everything the ΔE formulae do beyond Euclidean distance is compensating for that residue.

Where the numbers are used

Manufacturing tolerance. Paint, plastics, textiles and print all specify acceptable ΔE ranges against a standard. Automotive paint is among the tightest, since adjacent body panels are the worst possible arrangement — large areas, shared edge, viewed together.

Display characterisation. Reviews quoting an average ΔE for a monitor are measuring how far its output sits from the target for a set of test colours.

Image compression and rendering. Deciding whether a difference is worth encoding is a ΔE question, though most codecs use cruder approximations for speed.

In all three, the number is being asked to stand in for a judgement about a specific viewing situation, using a formula fitted to a different one. This is not a reason to abandon it; it is a reason to treat thresholds as guidance rather than as physics.

Why not just build a uniform space

This is the obvious response, and it has been tried repeatedly.

The difficulty is that perceptual colour space appears not to be flat. The discrimination contours vary in a way that cannot be removed by any smooth coordinate change — the geometry is intrinsically curved, and a flat coordinate system on a curved space always leaves distortion somewhere. Making the ellipses circular in one region distorts them elsewhere.

Doing the job properly means treating colour space as a Riemannian manifold and defining distance as the geodesic length under a metric fitted to discrimination data. This has been done, it works better than any of the ΔE formulae, and almost nobody uses it, because computing a geodesic is far more work than evaluating twenty lines of arithmetic and the improvement is modest for most purposes.

So the field has settled on a complicated formula over a simple space rather than a simple formula over a complicated one, on grounds that are entirely practical.

The shape of the disagreement

The three formulae do not disagree randomly. They disagree systematically, in ways that follow from what each was trying to fix.

ΔE76 overstates differences between saturated colours, because CIELAB stretches the space out toward high chroma more than perception does. ΔE94 discounts them with a chroma-dependent weighting. ΔE2000 discounts them further and adds the blue-region rotation on top.

So the gap between the oldest and newest formula is largest exactly where the colours are most saturated, which is also where a great deal of practical matching happens — brand colours, product finishes, dyed textiles are rarely muted.

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. 3 The underlying data. The ellipses are large in the greens and small in the blues, and it is the failure of CIELAB to equalise them fully that every term beyond Euclidean distance in ΔE2000 is compensating for.

Where the formulae are not the right tool

Three situations where a ΔE is the wrong measurement, and something else is wanted.

Ordering a palette. ΔE answers “how different”, not “how different in what way”. Two colours can be ΔE 20 apart in lightness or in hue, and for a palette those are not interchangeable. Working directly in a perceptual space’s lightness, chroma and hue coordinates says more than a single distance does.

Banding in a gradient. The relevant quantity is the step between adjacent bands, and adjacent comparison is far more sensitive than the thresholds ΔE was fitted to. A gradient with steps well under 1 can still band visibly.

Accessibility contrast. This is a luminance-ratio question, not a colour-difference question. Two colours can be far apart in ΔE and have almost identical luminance — a saturated blue and a saturated red, for instance — which makes them a poor foreground-background pair however different they look.

Four colour spaces ranked by how uniform they actually areThe spread — largest ellipse over smallest, after transformation — for each space. Raw chromaticity is worst at 10.4. The three perceptual spaces are all far better and close to one another, with CIELUV at 2.21 and Oklab at 2.57 — a smaller gap than the usual advocacy suggests.CIE 1931 xy10.42aniso 2.95CIELAB3.24aniso 3.42CIELUV2.21aniso 2.37Oklab2.57aniso 2.27spread: largest JND ellipse ÷ smallest (1 is perfect)measured, not quotedat Y = 0.4
Fig. 4 The measurement behind all of this. No space in use is uniform; the best manages a spread of about two. Everything the ΔE formulae do beyond Euclidean distance is compensating for that residue, and the complexity of ΔE2000 is the size of the residue made visible.

Why the formulae keep the space

An obvious question is why the CIE did not simply define a better space in 2000 rather than a more complicated distance on the old one.

Part of the answer is inertia — CIELAB was embedded in standards, instruments and software by then. The more interesting part is that it may not be possible. The discrimination data suggests perceptual colour space is intrinsically curved, and a flat coordinate system on a curved space always leaves distortion somewhere. Making the contours circular in one region distorts them in another.

Treating the problem properly means defining distance as a geodesic under a metric fitted to discrimination data, which has been done and works better than any ΔE formula. Almost nobody uses it, because a geodesic is far more expensive than twenty lines of arithmetic and the gain is modest for industrial tolerance work.

So the field has a complicated formula over a simple space rather than a simple formula over a complicated one, entirely for practical reasons. The measurement showing why is eighty years old.

What was computed here

The CIEDE2000 implementation on this site is validated against the Sharma–Wu–Dalal test set, and this is one of the few places where a published test set exists precisely because the formula is so easy to get subtly wrong.

Fifteen pairs are checked, chosen by their authors to exercise the branches implementations fail on: hue angles straddling 360°, zero chroma where the hue is undefined, and the rotation term in the blues. The maximum deviation from the published values is 4.2×1054.2\times10^{-5}.

The gate also checks that passing the test set means something. A plain Euclidean distance is evaluated on the first test pair and must be far from the ΔE2000 answer — it gives 4.01 against 2.04, so the set discriminates by a factor of two rather than certifying anything that happens to be close.

The uniformity figures come from the ellipse measurement, computed at build time rather than quoted.

The uniformity numbers quoted are computed at build time from the ellipse parameters rather than transcribed, so the table and the figures cannot drift apart. The ranking assertion requires raw chromaticity to come out worse than CIELAB, which is the result MacAdam’s experiment established — a measurement failing to reproduce it would be measuring nothing.

Choosing a formula in practice

The decision is usually simpler than the formulae suggest.

Use ΔE2000 for anything where the number will be compared against a published threshold or a tolerance specification. It is the current standard, the thresholds in circulation are calibrated to it, and its complexity is somebody else’s problem once the implementation is verified.

Use ΔE76 when the metric properties matter — clustering, nearest-neighbour search, anything requiring the triangle inequality. ΔE2000 is not a metric and will produce incoherent results in an algorithm that assumes one.

Use a perceptual space’s coordinates directly when the question is about how two colours differ rather than how much. Lightness, chroma and hue separately say more than any scalar.

How uniform CIELAB is, measured against MacAdam's ellipsesFor each of the 25 ellipses, the ratio of its longest to its shortest radius after transforming into CIELAB (a circle would give 1), and its mean radius. Mean anisotropy is 3.42 and the largest ellipse is 3.2 times the smallest. A perfectly uniform space would give 1 and 1.1CIELAB: anisotropy 3.42, spread 3.2the 25 ellipses, in table ordergold: max/min radius per ellipse · grey: relative size1 would be a circleat Y = 0.4
Fig. 5 Why the choice matters at all. CIELAB’s discrimination contours after transformation — the residual non-uniformity that every term beyond Euclidean distance is compensating for, ellipse by ellipse.

The implementation trap

CIEDE2000 has a reputation for being difficult to implement correctly, and the reputation is earned.

The failure modes are all in the hue arithmetic. Hue is an angle, angles wrap at 360°, and the formula requires both a hue difference and a hue mean, each with its own wrapping rule. When either chroma is zero the hue is undefined and must be special-cased rather than allowed to become a NaN that propagates silently.

Sharma, Wu and Dalal published their test set in 2005 after finding that independent implementations disagreed with one another — not by rounding, but by amounts large enough to change a pass into a fail. The set exists because the formula is hard, and any implementation not checked against it should be assumed wrong.

Why the formulae are as complicated as they are

One sentence, and it is the summary of this essay and the one before it: the space is not uniform, nobody has managed to make one that is, and every term beyond Euclidean distance is compensating for the shortfall.

Four colour spaces ranked by how uniform they actually areThe spread — largest ellipse over smallest, after transformation — for each space. Raw chromaticity is worst at 10.4. The three perceptual spaces are all far better and close to one another, with CIELUV at 2.21 and Oklab at 2.57 — a smaller gap than the usual advocacy suggests.CIE 1931 xy10.42aniso 2.95CIELAB3.24aniso 3.42CIELUV2.21aniso 2.37Oklab2.57aniso 2.27spread: largest JND ellipse ÷ smallest (1 is perfect)measured, not quotedat Y = 0.4
Fig. 6 The residual the formulae exist to patch. No space in use scores near 1, and the complexity of ΔE2000 is the size of that residue made visible.

A final caution about thresholds. Numbers like “ΔE 1 is a just-noticeable difference” travel widely and lose their conditions on the way. The condition is side-by-side comparison, under controlled lighting, against a neutral background, by an observer attending to the comparison. Loosen any of those and the threshold moves, usually upward and sometimes by a large factor — which is why a specification quoting a ΔE tolerance should also quote the viewing arrangement it applies to.

It is worth adding that the formulae describe thresholds, and most design decisions are made well above threshold. Choosing whether two categories in a chart are distinguishable is a suprathreshold question about whether a reader will confuse them at a glance, across a page, while attending to something else. ΔE is calibrated for a much more favourable comparison than that, so passing a threshold is a floor rather than a guarantee.

What the pictures cannot show

A ΔE value is a scalar summarising a three-dimensional difference, and no figure can show what was lost in the summary. Two pairs with the same ΔE can differ in completely different ways — one in lightness, one in hue — and the number does not distinguish them. In practice that distinction often matters more than the magnitude, which is why industrial specifications frequently give separate tolerances for ΔL\Delta L, ΔC\Delta C and ΔH\Delta H rather than a single ΔE.

The figures here also present colour differences on a display, under the reader’s viewing conditions, which are exactly the variables the formulae hold fixed. A pair the formula calls ΔE 2 may be clearly different or invisible depending on the room.

Who found it, and when

CIELAB and CIELUV were both adopted in 1976, as the CIE’s response to thirty years of complaints about the 1931 diagram’s non-uniformity. The intention was to standardise on one, and the failure to agree resulted in two.

ΔE94 came from the graphic arts industry’s dissatisfaction with ΔE76. CIEDE2000 was developed by a CIE technical committee through the late 1990s and published in 2001, fitted to several combined datasets. Sharma, Wu and Dalal published their implementation notes and test data in 2005 after finding that independent implementations disagreed with one another — which is a fair indication of how tractable the formula is.

Where this goes next

The measurement problem underneath all of it is MacAdam measured it. The reason a ΔE cannot answer appearance questions is matching is not appearance. And the other place where a scale fails to be linear is the midpoint is not half.