Difference and uniformity

A difference is not a distance

Two earlier essays here said that CIEDE2000 violates the triangle inequality and left it at that. Searching for the violation finds a detour half the length of the direct route, a smaller one inside a five-unit ball, and a second defect nobody mentions — ΔE94 is not even symmetric.

Assumes How far apart are two colours and Where the formula is not smooth.

Two essays on this site say, in prose, that CIEDE2000 is not a metric. One of them recommends ΔE76 for clustering on those grounds; the other says three colours can be arranged so that going via the middle one is shorter than going direct. Both are true. Neither had a number attached, anywhere on this site, which is exactly the kind of claim this site exists not to leave standing.

The worst triple found, under ΔE2000. Three colours, plotted on the a–b plane of CIELAB. Going from a to c directly is 123.645; going via b is 60.528, which is 51.0 per cent shorter. A distance cannot behave that way, and this one is the formula every colour tolerance in industry is written in. The colours are far apart, which is where the violation is largest; the same search confined to tolerance scale finds a smaller one that has not gone away.
Fig. 1 The worst triple found by search. Going from a to c directly is ΔE00 123.65; going via b is 60.53, which is 51 per cent shorter. A quantity called a distance cannot do that, and this one is the formula every colour tolerance in industry is written in.

The claim

Of the four things a metric has to be, ΔE2000 keeps three and ΔE94 keeps two — and the failures are large, findable by search, and consequential for anything that chains differences.

ΔE76 ΔE94 ΔE2000
non-negative yes yes yes
zero only for identical colours yes yes yes
symmetric yes no — up to 47.6 units yes
triangle inequality yes no — 42% short no — 51% short

The first column is the control. ΔE76 is the Euclidean distance in CIELAB, so it satisfies all four by construction and the searches find nothing — asymmetry exactly zero, worst triangle deficit 7.5 × 10⁻¹², which is arithmetic noise. A search that found no violation of ΔE2000 either would be a search that does not work.

Symmetry, and the one nobody mentions

ΔE94 is asymmetric by construction, and it is not an implementation detail or a rounding artefact: its weighting functions are built from the chroma of the first argument, which the standard calls the reference and the second of which it calls the sample.

SC=1+K1C1,SH=1+K2C1S_C = 1 + K_1 C_1, \qquad S_H = 1 + K_2 C_1

Swap the standard and the batch and the number changes. Searched over four thousand pairs:

  • worst gap 47.55 units — one order giving 65.69 and the other 18.14, a ratio of 3.6
  • mean gap 5.22

The worst case pairs a near-neutral light colour with a saturated dark one, which is exactly the arrangement a “compare this batch against the reference” workflow produces. And it survives at tolerance scale: restricting the search to pairs about four units apart still finds a gap of 0.73, on a quantity being compared against a limit of 1.

So a specification reading “ΔE94 ≤ 1” has an unstated argument in it. Two laboratories following it exactly, differing only in which sample they enter first, can disagree about whether a batch passes.

ΔE94 against itself, with the two arguments swapped. Each point is one pair of colours, plotted as the formula's answer one way round against its answer the other. A symmetric formula puts every point exactly on the diagonal. ΔE94 does not: the largest departure is 47.6 units and the mean is 5.07, because its weighting functions are built from the chroma of whichever colour is named first. A specification quoting it has an unstated argument order in it.
Fig. 2 Twelve hundred pairs, plotted as the formula’s answer one way round against its answer the other. A symmetric formula puts every point on the diagonal. This one does not, and the departure grows with how far apart the colours are — because the weighting is built from one of them.
ΔE2000 against itself, with the two arguments swapped. Each point is one pair of colours, plotted as the formula's answer one way round against its answer the other. A symmetric formula puts every point exactly on the diagonal. ΔE2000 does: the largest departure over twelve hundred pairs is 0.0e+0.
Fig. 3 The same search on CIEDE2000, which is symmetric: the largest departure over twelve hundred pairs is exactly zero. The 2000 formula fixed this by weighting on the mean chroma of the pair rather than on the first argument’s, and the fix is complete.

The triangle inequality

A distance obeys d(a,c)d(a,b)+d(b,c)d(a,c) \le d(a,b) + d(b,c): no detour is shorter than going straight. Searching triples and then walking locally to the worst one found:

formula direct via the middle shortfall
ΔE94 112.71 65.04 −42.3%
ΔE2000 123.65 60.53 −51.0%

The triple that does it is instructive: all three colours at L* 44, one at a* −84, one neutral, one at a* +88. Going from a strong green to a strong red via grey is half the price of going directly. That is CIEDE2000’s chroma weighting doing its job — differences between saturated colours are discounted heavily, and the discount is applied to each leg separately.

Those colours are enormously far apart, which is the honest objection: nobody chains differences of a hundred units. So the same search was run inside a five-unit ball, which is the scale a tolerance is written at:

  • direct 4.996, via 4.965, shortfall 0.63%

Smaller, real, and in the range where somebody is actually accumulating differences.

The worst triple found inside a five-unit ball, under ΔE2000. Three colours, plotted on the a–b plane of CIELAB. Going from a to c directly is 4.996; going via b is 4.965, which is 0.63 per cent shorter. A distance cannot behave that way, and this one is the formula every colour tolerance in industry is written in. This triple is confined to a ball five units across — the scale a specification is actually written at — so the defect is not a curiosity of colours nobody compares.
Fig. 4 The same failure at tolerance scale. Three colours inside a ball five units across, where the detour is still cheaper than the direct route. The violation is not a curiosity of colours nobody compares — it is a property of the formula that persists wherever the formula is used.

What it costs a path

The practical form of a triangle violation is a route. Walk the straight line between two colours in equal steps, add up the differences, and compare with the direct figure:

steps sum direct short by
4 54.22 57.14 5.1%
8 53.92 57.14 5.6%
16 53.72 57.14 6.0%
32 53.69 57.14 6.0%
64 53.68 57.14 6.1%

The sum converges, from below, to about six per cent under the direct answer. That is a colour-difference formula reporting that a journey is shorter than its own endpoints, and it converges — so it is not a discretisation artefact that a finer walk would remove.

Anything that accumulates differences is affected: a gamut-mapping search that measures the cost of a route, a clustering algorithm that assumes distances behave, a palette optimiser that sums pairwise separations, a nearest-neighbour lookup in a profile.

Walking there in steps, and adding them up. The direct ΔE2000 between two colours is 57.14. Walking the straight line between them in equal steps and adding the differences gives 54.22 in 4, 53.92 in 8, 53.72 in 16, 53.69 in 32, 53.68 in 64 — every one of them short of the direct figure, by up to 6.1 per cent. A quantity called a distance cannot do that, and anything that accumulates differences along a route is affected by it.
Fig. 5 The sum of the steps against the number of steps, with the direct distance marked. Refining the walk does not close the gap — it opens it slightly and then settles, which is what a genuine violation looks like as opposed to a numerical one.

The violation has a scale, and that is the useful part

The two headline numbers are 51 per cent at a hundred and twenty units and 0.63 per cent inside a ball five units across. That ordering is not a coincidence of the search, and saying why turns the defect from a curiosity into something a program can reason about.

Any difference formula that is locally a smooth positive-definite quadratic form obeys the triangle inequality on small enough triples, because on that scale it is a norm and a norm cannot fail. So a violation that shrinks as the triple shrinks is a sign that the failure is global — a property of how the formula reweights the space from one region to another, not something wrong at every point. That is exactly what CIEDE2000’s chroma weighting is: a discount applied according to where in the space the pair sits, which is coherent leg by leg and incoherent along a route.

Which leaves the 0.63 per cent inside the five-unit ball needing its own explanation, and the smoothness essay supplies it. ΔE2000 is not smooth everywhere: its hue-rotation term is switched by branch conditions, and across one of those the formula is not a quadratic form at all. So the small-scale residue is not a weaker version of the large-scale failure; it lives in a different place, and it lives where the formula stops being differentiable.

The two together predict the shape of the path result above. Refining the walk does not close the gap — it settles it — because the deficit is not accumulated at the joints, where a finer walk would put more of them. It is accumulated along the route, in proportion to how far the route travels through regions the formula weights differently. Halving the step doubles the number of joints and changes the journey not at all, which is precisely what a converging sum from below looks like and is why the sixth per cent is not a discretisation artefact.

And the knobs

There is a fifth thing wrong with treating ΔE as a distance, and it is not an axiom: the formula has parameters.

kLk_L, kCk_C and kHk_H scale the three components before the distance is taken. Textile practice uses kL=2k_L = 2; almost everything else leaves all three at 1. Both are written down as “ΔE2000”, and this site has twice said so without computing it. Computed:

tolerance pairs where the two settings disagree
0.5 1.3%
1.0 14.6%
2.0 20.4%

At the commonest tolerance in use, one pair in seven is accepted by one industry’s version of the formula and rejected by another’s. The two verdicts are not approximations of each other; they are answers to different questions, and only one of them is written on the specification.

What kL = 2 does to a tolerance of 1 ΔE00. Textile practice halves the weight given to lightness differences and everything else leaves it at one, and both are called "ΔE2000 ≤ 1". Of 4000 pairs at production scale, 584 — 14.6 per cent — are accepted by one setting and rejected by the other. The rows below are six of them: same pair, same formula, different verdict.
Fig. 6 Six pairs where the choice of parametric factor decides the verdict. Every one is a pair that passes under one industry’s convention and fails under another’s, with the same formula named on both.

Where it actually bites

Three places, in rising order of how badly.

A tolerance against a reference does not care. Pass-or-fail against a master is a single pairwise number, and none of the defects above touches it — which is why the formula has survived twenty-five years of industrial use without anybody minding. A tolerance is a shape, and the shape is drawn around one point.

A search or a sort cares quietly. Nearest-neighbour lookup, palette selection, clustering into named categories and gamut mapping all assume distances behave. They do not crash; they return a slightly wrong answer, consistently, and it is invisible without a reference implementation to compare against.

And a chain cares loudly. Anything that adds differences along a route — the cost of a gradient, the accumulated error through a pipeline, the total of a profile’s interpolation errors — is summing a quantity that does not sum. Six per cent under, on the path measured here, and there is no bound on it in general.

A formula that keeps all four, and this site already uses it

The table’s first column invites a pessimistic reading — that the four axioms and accuracy are in trade, with ΔE76 at one end and ΔE2000 at the other. That reading is too strong, and the counterexample is a formula quoted on nearly every other page of this collection.

CAM16-UCS is computed here as a Euclidean distance in the uniform coordinates JabJ'a'b', scaled and then raised to the power 0.63 — the exponent the partial-correction essay had to recover before its arithmetic would come out. That power is what gives the unit its near-end behaviour, and the natural worry is that it also breaks the geometry. It does not, and the reason is a one-line piece of analysis rather than a search: t1.41t0.63t \mapsto 1.41\,t^{0.63} is increasing, zero at zero, and concave, so it is subadditive — f(x+y)f(x)+f(y)f(x+y) \le f(x) + f(y) — and a subadditive increasing function of a metric is a metric. All four axioms survive the exponent.

Asserted rather than assumed, the same search was pointed at it: the same box, the same sampler, the same local walk that doubles ΔE2000’s violation.

ΔE2000 CAM16-UCS
worst asymmetry, over 4,429 pairs 0 0
worst triangle deficit found −51.0% none — best walk reaches −0.58%

The second row is the one to read carefully. A negative number there means the direct route stayed the shorter one, so the walk that reliably manufactures a violation for ΔE2000 could not manufacture one at all. A search finding nothing means something only because the identical search finds the other formula’s failure immediately.

And this does not retire the rule at the end of this essay, for three reasons that are worth having in one place. CAM16-UCS is a metric because it was built as a distance in a space, not because anybody checked; it is fitted to how far apart plainly different colours look, so it is a good metric of the wrong quantity for threshold work; and it is not a function of two colours at all, but of two colours and a room, so two of its distances are comparable only within one viewing condition. Its domain is smaller too — 142 of 9,000 points sampled from the box these searches run in have no finite CAM16 report, because the appearance model is not defined out there and the matching formulae are.

That is why this site’s own difference.js keeps it out of the dictionary the other three share, with a comment saying so: putting them in one table would invite exactly the substitution this section might otherwise be read as recommending. The axioms are cheap. Agreeing with observers is not, and no formula on this page does both.

What was computed, and how

The search samples CIELAB in a box — lightness 0 to 100, chroma to ±60 — with a small deterministic generator, so the same figure is drawn on every build. Random triples give a starting point; a short coordinate walk on the best one typically doubles the violation, because the failure is a local property and a uniform sample is coarse.

The span limit turns the same search into the practical question. Points are placed within a stated ΔE00 of one another and any move that pushes a pair outside the ball is rejected, so the reported triple is genuinely inside it rather than merely near it.

The formulae are the site’s own implementations, and one of them is checked against a published table elsewhere on the site: CIEDE2000 follows Sharma, Wu and Dalal’s reference formulation, whose paper exists because the original CIE publication left several branch conditions ambiguous.

The appearance search is the same sampler and the same walk, with the points carried into CAM16 at the reference viewing conditions before the distance is taken, and with the non-finite reports dropped rather than clamped — clamping would have invented points the model does not have an opinion about, which is the failure mode a search for a negative result is most exposed to.

And the assertions are two-sided. ΔE76 is required to be a metric — a violation there would mean the search is broken, since a norm cannot fail — and ΔE94 and ΔE2000 are required to violate, against a floor. A search that quietly stopped searching would then be caught by the same suite that reports the violation.

The older formula fails the same axiom, and by considerably more, which is what makes the failure structural rather than a quirk of the newest revision.

The worst triple found, under ΔE94. Three colours, plotted on the a–b plane of CIELAB. Going from a to c directly is 112.707; going via b is 65.073, which is 42.3 per cent shorter. A distance cannot behave that way, and this one is the formula every colour tolerance in industry is written in. The colours are far apart, which is where the violation is largest; the same search confined to tolerance scale finds a smaller one that has not gone away.
Fig. 7 Three colours on the a*–b* plane. Going from a to c directly is 112.707 and going via b is 65.073 — 42.3 per cent shorter. A distance cannot behave that way, and this is the formula a great deal of tolerance work still uses.

Where the model stops

A violated axiom is not evidence about people. Nothing here says an observer’s judgements violate the triangle inequality; it says a formula fitted to those judgements does. Whether perceived difference is itself non-metric is a genuinely open question and a much harder measurement, and it is not made here.

The searches are searches. They report the worst case found, not the worst case that exists. Every number above is a lower bound on the defect.

A search that finds nothing is a bound, not a proof — except where it is not. The CAM16-UCS result above is stated twice deliberately: the argument from concavity is a proof and holds everywhere, and the search is there to catch an implementation that does not match the formula it claims to be. Only the first of those two is evidence about the metric; the second is evidence about this site.

The box is CIELAB and it is not all of it. Chroma is limited to ±60 and lightness to the full range; a wider box finds larger violations, and a box restricted to real surface colours would find smaller ones.

And the parametric result depends on the sample distribution. Fourteen and a half per cent of these pairs flip at a tolerance of 1, where the pairs are drawn to sit a few units apart in a uniform box. A real production distribution — clustered near a target, mostly lightness differences — would give a different number, and the direction is unknowable without the data.

The violation does not need distant colours: near threshold, where every tolerance actually lives, the same triple is still short by a measurable margin.

The worst triple found inside a five-unit ball, under ΔE94. Three colours, plotted on the a–b plane of CIELAB. Going from a to c directly is 5.000; going via b is 4.779, which is 4.42 per cent shorter. A distance cannot behave that way, and this one is the formula every colour tolerance in industry is written in. This triple is confined to a ball five units across — the scale a specification is actually written at — so the defect is not a curiosity of colours nobody compares.
Fig. 8 The same construction with the three colours a few units apart. Direct is 5.000 and via b is 4.779 — 4.42 per cent shorter — so the axiom fails at the sizes a specification is written about and not only at the sizes a demonstration uses.

The generalisation

The useful distinction is between a measurement and a metric, and colour science needs both while conflating them constantly.

ΔE2000 is an excellent measurement. It answers “how different do these two colours look” better than anything else available, on the data it was fitted to, and its complexity is the price of that accuracy: every one of its correction terms exists because a simpler formula got a class of pairs wrong.

It is a poor metric, and for exactly the same reason. Each correction is a local reweighting of the space, and a distance that reweights itself depending on where it is measured is not the length of anything. The two properties are in tension by construction: a formula fitted pair by pair is not obliged to integrate into a geometry.

The smoothness essay makes the point in its differential form — ΔE2000 is not the geodesic distance of any Riemannian metric — and this one makes it in the finite form that a program can trip over. Together they say what the right shape for a future formula would be: a positive-definite tensor field on colour space, with differences as geodesic distances. That object is symmetric, obeys the triangle inequality and is smooth wherever the tensor is, all for free, because those properties are what a metric is.

The threshold essay makes a third version of the same complaint from the data side: MacAdam measured the smallest difference anybody could detect, CIEDE2000 was fitted to how far apart plainly different colours look, and the two are quoted interchangeably. A formula assembled from two incompatible families of measurement is under no obligation to be a geometry, and it is not.

Until such a formula exists, the rule is procedural rather than mathematical. Use ΔE2000 to compare a pair against a limit, and never to chain, cluster, average or search. That is not a compromise; it is using a measurement for what it measures.

Which of the four metric axioms each formula keeps. Non-negativity and identity hold for all three by construction. Symmetry and the triangle inequality are searched for, over hundreds of pairs and triples. ΔE76 keeps both, which is the control that makes the other rows mean something: it is a Euclidean distance and could not fail. ΔE94 fails symmetry by up to 47.6 units. Neither ΔE94 nor ΔE2000 keeps the triangle inequality, and the worst triples found are 37 and 37 per cent short of the direct distance.
Fig. 9 The four axioms against the three formulae, every entry searched rather than quoted. The row that matters is the first: a formula that keeps every axiom exists, is fifty years old, and is not accurate enough to use — which is the trade the whole subject has been making ever since.

Who found it, and when

That ΔE94 is asymmetric was known when it was published — the standard names one argument the reference — and it was one of the motivations for CIEDE2000, which weights on the mean chroma instead.

That CIEDE2000 violates the triangle inequality has been reported repeatedly in the colour-science literature since shortly after its adoption in 2001, usually as a remark in papers about colour spaces rather than as a result in its own right. It is not controversial and it is not widely known outside the field, which is the usual fate of a defect in a standard that works well for its intended use.

What is genuinely current is the search for a replacement of the right shape. Work on Riemannian formulations of colour difference, and on line elements going back to Helmholtz and Schrödinger, has never stopped; what has changed is that the computational cost of a geodesic distance is no longer an argument against one.

Where the ladder goes next

Two things follow directly from the machinery here.

The first is a positive construction: this site now has the pieces to build a geodesic difference — a tensor field interpolated from the ellipses, and a shortest-path solver — and to measure whether it agrees with CIEDE2000 where CIEDE2000 is trusted while behaving properly where it does not. That is a real piece of work and it would settle by measurement whether the metric properties cost accuracy or come free.

The second is the spatial one, and it goes the other way. A colour difference has no extent, and every number in this essay is about two large uniform patches. A formula that failed the triangle inequality by six per cent and mispredicted an image by a factor of five would have its priorities in the wrong order, and the second failure is larger.

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

Every essay whose body links to this one.

The objects this essay names

Each one links to every other essay that touches it.

AssertionCIEDE2000CIELABΔEGamut mappingMetric axiomsPerceptual uniformityQuality controlSpecificationTolerance