Two converters and one highlight
Assumes A stop is not a stop afterwards, A blown highlight turns and The order is not in the documentation.
The first rung of this ladder found that exchanging the tone curve and the clip costs exactly nothing, and called it a theorem. It is a theorem, and it is a theorem about one particular clip: the clamp to the unit interval at the end of the chain. There is another clip, it is not the same operation, and it is the one converters disagree about.
The claim
The clip’s position is invisible below the sensor’s ceiling and decisive above it, and two defensible placements disagree about a highlight by twenty-one colour differences.
- Below the ceiling the two placements agree exactly — to 0.0, not to a tolerance — because there is nothing to clip.
- Above it they reach 20.96 colour differences and 77.9 degrees of hue on the direction measured first.
- Which directions disagree is a property of the camera. Over twelve directions in the raw channels the disagreement runs from 3.3 to 32.6 colour differences, and the hue rotation from 2 degrees to 102.
- And the disagreement is not monotone in how far over the ceiling the highlight is: at 1.2 times over it is 18.9, at 1.6 it is 21.0, and at 3.0 it is 20.9.
Two clips, and why they are different
The clamp at the end of a pipeline is a clamp to what the destination can hold. It is a property of the encoding — an eight-bit file cannot hold 1.2 — and it applies to values that have already been through everything.
The clip at the sensor is a property of the measurement. A photosite whose well has filled has stopped counting, and the number it reports is the same number it would report for twice as much light — which is where a blown highlight’s hue comes from. That is not a clamp applied to a value; it is a value that was never recorded.
Everything a converter does with such a site is a guess, and the guesses fall into two families. Clip early, which is to say clamp every raw channel at the sensor’s white before doing anything else: this treats a saturated site as a white one, and the highlight comes out neutral. Or clip late: carry the over-range value through the balance and the matrix and let the final clamp deal with whatever comes out. This preserves the ratios the unsaturated channels still carry, and the highlight comes out coloured.
Neither is wrong. Clipping early keeps a highlight neutral and clipping late keeps its hue, and photographers argue about which is preferable for the same reason they argue about everything else in this ladder: both answers are defensible and neither is recorded.
The exact half
The measurement’s most useful result is the one that is exactly zero.
A ramp running from four tenths of the sensor’s ceiling upwards is put through both placements. Below the ceiling the two agree to 0.0 colour differences — not to a rounding tolerance but identically, because a clamp applied to a value inside its own range is the identity function and the identity function commutes with everything — the same kind of exactness this round has used as a check throughout.
That is worth stating because it is what makes the whole question invisible in ordinary use. A converter’s clip placement has no effect whatever on a correctly exposed frame, so the choice can be made carelessly, tested on ordinary pictures, and shipped without anybody noticing. It surfaces only in the frames where somebody is already unhappy.
What it costs above the ceiling
On the first direction measured, the two placements reach 20.96 colour differences and 77.9 degrees of hue apart.
Twenty-one colour differences is not a subtlety and seventy-eight degrees is a different colour. The mechanism is straightforward: clipping early sets all three balanced channels to one, which is white; clipping late leaves the unsaturated channels at their measured values and lets the matrix mix them, which produces a colour with the direction the scene actually had and a magnitude nothing supports.
Across twelve directions the disagreement runs from 3.26 to 32.61 colour differences. The hue rotation runs from about two degrees to 102, and the two do not track each other: the direction with the largest colour difference has a hue rotation of three degrees, and the direction with the largest rotation is not the one with the largest difference.
That decoupling is the useful part. A large colour difference with a small hue rotation is a highlight whose chroma is wrong — one placement makes it whiter than the other. A large rotation is a highlight whose colour is wrong, which is what a viewer reads as a defect. The directions that produce the second are the ones a converter’s author would want to know about, and they are not the ones a mean would find.
Why it is not monotone
The obvious expectation is that the further over the ceiling a highlight is, the further apart the two placements land. It is not what happens.
At 1.2 times the ceiling the disagreement is 18.86; at 1.6 it is 20.96; at 3.0 it is 20.88. The curve rises, flattens and comes back, and the reason is that a very over-exposed highlight has saturated in every channel, at which point clipping early and clipping late both produce white and agree again.
So the disagreement lives in a band, and the band is the region where some channels have saturated and others have not. That is exactly the region highlight reconstruction operates in, and it is exactly the region a photographer is trying to rescue.
The band, measured
The non-monotone shape deserves its own account, because a defect that lives in a band rather than growing with the fault is a different kind of thing to specify against.
Below the ceiling the disagreement is zero. It rises steeply once the first channel saturates, reaches its maximum where roughly one channel of three has gone and the other two have not, and falls back as the second and then the third join it. At three times the ceiling every channel on this direction has saturated and both placements produce white.
So the disagreement is a function of how many channels have saturated, and it peaks at one of three. That is a statement a converter’s author can act on: the case to get right is the single-channel clip, which is also the case highlight reconstruction has the most information to work with, since two channels still carry the colour.
It also means over-exposing further can improve agreement between two converters, which is the opposite of every intuition about exposure and follows immediately from the shape. Two converters disagreeing about a blown sky will disagree less about a more blown one.
Which directions, and what decides them
The twelve directions are not equivalent and the pattern is the camera’s.
The largest colour differences appear at directions near 270 and 330 degrees, at 32.6 each, and near 120 at 31.3. The smallest is at 180, at 3.3. The largest hue rotation is at 120, at 102 degrees, and the direction with the largest colour difference has a rotation of only three.
What decides the pattern is which raw channel saturates first along each direction and what the matrix does with the two that remain. A direction that saturates the green channel first is the worst case, because green carries most of the luminance and the matrix’s green row has the largest coefficients: losing it forces the largest correction from the other two.
That makes the pattern a property of the camera’s own dyes and of the matrix fitted to them, so it differs between cameras and would have to be measured per model. It is not a property of the scene, of the light or of the observer, and none of the round’s earlier machinery predicts it.
The practical form is that a photographer’s experience of a converter’s highlight behaviour is subject-dependent in a way that has nothing to do with the subject: a blown sky and a blown skin highlight saturate different channels first and are therefore handled differently well by the same software.
What this does to the arrangement census
The first rung reported that three of the twenty-four arrangements are identical to the documented one. That result has a condition on it which can now be stated.
They are identical because nothing in the fit set is over the ceiling. The clip is a no-op on values inside the range, so moving a no-op around a chain changes nothing. On a set with clipped highlights in it those three arrangements separate, and by the amounts measured here.
The census is therefore a lower bound on how much the arrangement matters, not a measurement of it. Its 64.8 colour differences at the extreme are what the arrangement costs on unclipped material; the clipped case adds up to another 33 on top, in a region the census does not sample.
That is worth flagging as a limitation of the earlier rung rather than a new finding. A measurement over a chart is a measurement over things that fit on a chart — the chart decides the profile — and a chart’s whitest patch is a diffuse white, which is by construction below the ceiling.
The one asymmetry worth naming
The two placements are not symmetric in what they can be recovered from, and that asymmetry is the strongest argument either side has.
Clipping late is reversible up to the final clamp and clipping early is not. A converter that carries over-range values through the chain still has them until the encoder throws them away, so a downstream stage — a highlight reconstruction, a tone map with a soft shoulder, a wider output space — can still use them. A converter that clamped at the sensor has destroyed the same information at the first step and nothing later can recover it.
That is a reason to clip late that has nothing to do with which highlight looks better, and it is the reason most modern converters do. It is also why the disagreement measured here is asymmetric in a second sense: the early-clip result can be produced from the late-clip pipeline by adding a clamp, and the reverse is impossible.
A step that destroys information should be as late as it can be is a rule with no exceptions in a processing chain, and it is the only unambiguous verdict this ladder has reached. Everything else it has measured — the arrangement, the reconstruction’s domain, the curve’s shape — is a decision with two defensible answers.
What the round has and has not settled
Five rungs have now taken the chain between a sensor and a picture apart, and it is worth saying plainly which of the findings are verdicts and which are only prices.
Two are verdicts. The white balance belongs before the matrix, because it is an adaptation and an adaptation belongs in the receptors’ own coordinates. The clip belongs as late as possible, because it is the one irreversible step. Both are structural and neither needed a measurement to establish — the measurements say how much the alternatives cost, which is a different service.
Three are prices. Whether the curve goes before or after the matrix, whether the reconstruction happens in linear light or in the encoded variable, and how strong the curve is: all three are genuine design choices, all three are implemented both ways, and this round’s contribution is a number for each rather than an answer.
The prices are 0.60, 5.78 at an edge, and everything on the third rung. None of them is small against a delivery tolerance and all of them are invisible to every check anybody performs, because two converters making opposite choices both satisfy the documentation.
What a specification would need
The metadata field this round has asked for three times takes a particular form here, and it is a longer one.
Naming the arrangement is four words. Naming the reconstruction’s domain is one. Naming the clip’s behaviour needs three things: where the clamp is, what the sensor’s ceiling is per channel, and whether any reconstruction was attempted. The first two are cheap and the third is the one that cannot be compactly stated, for the same reason the reconstruction algorithm cannot.
The second of the three is the one that is actually missing. A raw file records a white level, and it is a single number or a per-channel triple depending on the format — but it is the level at which the manufacturer says the data stops being trustworthy, which is not the same as the level at which the well filled, and different converters interpret it differently. A converter that clips at the recorded white level and one that clips a few per cent above it are making the same decision differently, and the difference lands in exactly the band measured here.
So the disagreement between two converters on a highlight has at least three independent sources: where the clamp is, what white level it clamps at, and what reconstruction runs afterwards. This essay measures the first with the other two held fixed, which is the only way to get a number for it and is not what a photographer experiences.
What was computed, and how
The ramp runs along a stated direction in the camera’s three raw channels, from four tenths of the sensor’s white up to a multiple of it, in twenty-four steps. The direction is parameterised by an angle, which mixes the three channels in a fixed proportion so that they reach the ceiling at different exposures — a direction with all three equal would saturate all three at once and produce no disagreement at all.
Clipping early clamps each raw channel at the sensor’s own white for that channel, which is what the sensor does. Clipping late leaves the raw values alone and relies on the final clamp. Everything between is the documented pipeline with its fitted matrix.
The comparison is in CIELAB after the whole chain, which is the right place for it: a highlight is judged as it appears, and the two placements produce different appearances rather than different intermediate values — priced with the formula this round has used throughout.
Where the model stops
No highlight reconstruction is modelled. Every serious converter attempts to recover a saturated channel from the unsaturated ones, and a good reconstruction narrows the gap between the two placements considerably — so the numbers here are what the disagreement costs with the repair switched off.
The sensor’s ceiling is taken as the same in all three channels, which is a simplification: real sensors saturate at different raw values per channel, and the white balance gains mean the three reach the ceiling at different scene luminances. That makes the band wider and the analysis the same.
And a real converter’s clip is not a hard clamp but a soft roll-off in most cases, which is a curve rather than a clip and therefore belongs to the previous rungs. The hard clip measured here is the limiting case and the worst one.
The generalisation
The habit is about a step whose effect is null on every case anybody tests.
A clamp, a fallback, an error branch, a default value: each of them does nothing at all on the inputs a test suite contains, because the test suite contains the cases the system was designed for. Their behaviour is exercised only by the inputs somebody is already unhappy about, which is where they matter most and where they are least examined.
The move is to test the null step on the inputs that are not null — deliberately, by constructing them, rather than waiting for them. Here it took a ramp and an angle.
The failure mode is that the placement of such a step is decided by convenience, since nothing distinguishes the options, and the decision is never revisited because nothing has ever gone wrong with it. A step that does nothing has no advocate, and the arrangement it ends up in is whichever one the code happened to be written in.
Who found it, and when
That clipping turns a highlight’s hue is standard and is what highlight reconstruction exists to address; this collection measured it in an earlier round and found rotations up to sixty-seven degrees.
The comparison between placements does not appear in the sources consulted here. Converters differ in their behaviour on blown highlights and the differences are widely discussed among photographers, usually attributed to different reconstruction algorithms — which is one of the two mechanisms and probably the larger. Where the clamp itself sits is the other, and it is available to be measured on any converter by photographing a ramp.
Where the ladder goes next
This round has taken the four operations between a sensor and a picture apart and found the same shape in each: the order is a decision, the decision is unrecorded, and the cost is comparable to everything else in the chain. The object it has not reached is the one at the far end, where a colour stops being a stimulus and starts being an appearance — and that model’s compression is steeper than any curve here, its inverse is not a formula, and everything this round measured happens before it is called.
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.
- A contrast control is three controls declared input · hue quadrature · specification · structural choice · transfer function
- An average on the stored values colour management · declared input · specification · structural choice · transfer function
- An intent is not a function of the colour colour management · declared input · reproducibility · specification · structural choice
- A chain measured in a unit that cannot add colour management · declared input · specification · structural choice
- A lattice has no derivative declared input · specification · transfer function · worst case
- The budget adds two units colour management · declared input · specification · worst case
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.
ClippingColour managementDeclared inputDynamic rangeHue quadratureReproducibilitySpecificationStructural choiceTransfer functionWorst case