Concept

White balance — where it appears

A per-channel gain applied to a camera's raw values so that a chosen neutral comes out neutral. It is a von Kries adaptation in whatever axes the filter dyes happen to give, and those axes are not chosen by anybody and move with the light.

Named by 25 essays across 4 fields — each of them below, with the objects they name alongside it.

One reflectance, two illuminants, two colours. A reflectance peaking near 580 nm, and the colours it produces under D65 and A. The object has not changed. The light has, and colour is a property of the pair.

Constancy is the default

A sheet of paper looks white in daylight and white under a tungsten lamp, although the light reaching the eye differs enormously. The visual system is solving one equation with two unknowns, and it solves it by assumption.

brain · Appearance
five greens, no neutral, under D65 — four guesses at the illuminant. The scene's surfaces as they reach the eye, and each estimator's angular error in degrees against the illuminant that actually lit them. Grey-world 43.1°, Max-RGB 27.7°, Shades-of-grey (p = 6) 31.4°, Grey-edge 34.4°. The best here is Max-RGB, which is best because this scene happens to satisfy its assumption — something reflects fully in every band — and not because it is the better algorithm. Any hatched patch is a surface this display cannot show under this light.

The algorithms that guess the light

What reaches a sensor is an illuminant multiplied by a reflectance, and no arithmetic separates a product into its factors. Every white-balance algorithm therefore works by assuming something about the world — and the interesting content of each is not its formula but the assumption, because a scene can violate it.

brain · Appearance
Everything between the photons and the picture, and what each stage decides. The 8 stages of a camera pipeline. Only the second is physics; every one after it is a decision somebody made, and the reason two cameras pointed at the same scene disagree is that they made different ones.

Raw is not a picture

A raw file is three integrals per site and a list of decisions nobody has taken yet. Every one of those decisions has a defensible answer and none of them has a correct one, which is why two converters open the same file and disagree.

imaging · Capture
A camera profile is a fit, and the sample set is a hidden argument to it. Per-surface ΔE00 after the best 3 × 3 from raw to XYZ, fitted on 12 surfaces at chroma 0.2 and tested twice: on those same surfaces (mean 0.65) and on 12 at chroma 0.9 (mean 1.75). Both bars come from the same matrix; only the surfaces differ.

A camera profile is a fit

Since no matrix is exact, the one a manufacturer ships is a least-squares compromise over a set of surfaces somebody chose. Fitted on desaturated patches it is excellent on desaturated patches — and the sample set is a hidden argument to every camera profile in existence.

imaging · Capture
Recovering the lamp from a highlight rather than from an assumption. A green scene under illuminant A. The faint curve is the true lamp; the solid one is what the interface component of the glossy surfaces recovers, which is 0.30° from it. Grey-world on the same scene is 42.1° and max-RGB 17.5°, because both are assumptions about the surfaces and a Fresnel reflection is not.

The highlight is the white balance

Every estimator a camera uses is an assumption about the scene wearing the costume of a measurement. The specular component of a glossy surface is not — it carries the illuminant to within a third of a degree on a scene where averaging is fifty times worse, and it does so without knowing what colour the paint underneath is.

imaging · Capture
Everything between the photons and the picture, and what each stage decides. The 8 stages of a camera pipeline. Only the second is physics; every one after it is a decision somebody made, and the reason two cameras pointed at the same scene disagree is that they made different ones.

A photograph is not a measurement

A photograph is a measurement made by an instrument whose kernel nobody published, under an illuminant nobody recorded, corrected by a matrix fitted to somebody else's surfaces, with two thirds of every pixel invented. It supports relative claims well and absolute ones badly, and it is used for the second.

imaging · Capture
How wrong a camera profile is, and who it is wrong for. A colour matrix fitted against the 1931 observer, evaluated four ways. Its residual against that observer is ΔE00 0.92 — the Luther failure, which is a property of the sensor and is the honest measurement of the camera. Against a person drawn from a population of 160, the worst-off twentieth report 3.35. And a camera with no spectral error whatever, reporting the standard observer's own tristimulus values exactly, would leave 3.47. The camera is not the problem. It was fitted to somebody who does not exist, and so is the standard it was fitted against.

Fitted to an eye nobody has

A camera profile's residual against the observer it was fitted to is under a unit, and that is the number everybody quotes. Against a person drawn from a population it is 3.35 at the ninety-fifth percentile — and a camera with no spectral error whatever, reporting the standard observer's tristimulus values exactly, would carry 3.47. The camera is not the problem.

imaging · Capture
The basis a camera balances in is a different basis for every light. A camera's white balance is a per-channel gain on raw values, which is a von Kries adaptation in whatever basis the filter dyes give it. That basis is not a property of the dyes alone: it is the dyes and the light in the room, and it moves when the light does. Each bar is how far the basis has turned, in degrees, from where it sits under D65. A sensor satisfying the Luther condition would have a bar of exactly zero on every row, because for such a sensor the light cancels — which is the one property nobody buys a sensor for.

A camera balances in another basis

White balance is a per-channel gain on raw values, which makes it a von Kries adaptation in whatever axes the filter dyes happen to give. Those axes are not a property of the dyes alone — they move with the light, by up to seventeen degrees across the adaptation census — and the sensor for which they would not move is the one that adapts worst of all.

imaging · Capture
Four devices, and what each of them can do about a change of light. The mean over the census of what each device is left with. A press has no mechanism, so its number is the whole change — a printed sheet does not adapt to the room it is read in. A display can move its white point, which is a gain in its own primaries. A camera applies a gain in whatever basis its filter dyes happen to give it. And the sensor that satisfies the Luther condition exactly is worse than the silicon one — satisfying the condition means its channels are the matching functions, and a per-channel gain on the matching functions is the transform this site calls the oldest mistake still shipping.

Only one of these devices adapts

An eye, a camera, a display and a press all meet the same changes of light, and each has at most one thing it can do about them. The press has nothing at all, so its column is the whole change; and this collection's sensor built to satisfy the Luther condition exactly is the one that adapts worst.

limits · Limits
Two lamps of the same colour, and one sheet that is two colours under them. The same brightened sheet under a xenon flash, the same flash behind its cover glass, and a phosphor-converted white LED of nearly the same chromaticity. Each patch is computed relative to its own lamp's white, which is what a perfect white balance does — so everything a camera can see and correct has already been removed. What is left is ΔE00 11.8 between the first and the last, against 3.2 between the two lamps themselves. The LED has no emission below 380 nanometres at all, because its pump die is at 450, so the sheet simply does not fluoresce under it and nothing in the photograph records why.

A camera cannot record the excitation

Two lamps of nearly the same chromaticity, one with ultraviolet and one with none, put a brightened sheet twelve units apart after a perfect white balance. Nothing in the camera measured the difference — the filter stack removed the band before the sensor saw it — so the correction that would fix the picture needs a quantity the file does not contain.

imaging · Capture
The lamps the four conditions shine, where they differ. The short-wave half of what each measurement condition puts on the sample, plotted to 560 nanometres because past that the three are indistinguishable in shape. M₁ is D50 with its ultraviolet; M₂ is the same lamp behind a cut filter at 400 nanometres, and at 360 it is 0.0 per cent of what M₁ delivers; M₀ is a tungsten lamp, which has some ultraviolet, has less than daylight, and is not specified at all by the standard — so two M₀ instruments need not agree with each other. M₃ is not plotted because its lamp is M₂'s; what makes it a fourth condition is a polariser.

The lamp that stopped emitting ultraviolet

A blue-pumped white LED has a die at 450 nanometres and emits nothing shorter. Between about 2005 and 2020 that lamp replaced almost every other indoor source, which removed the excitation supply from a great many rooms — so brightened materials stopped glowing indoors without a single one of them being reformulated.

imaging · Capture
How short of determining the light a photograph is, as the scene grows. Each cell is the number of unknowns left over after every equation the image supplies: three sensors, a three-dimensional illuminant, and reflectances confined to a linear model of the dimension on the left. At one and two dimensions more surfaces close the gap. At three the gap never closes, because each further surface adds three equations and three unknowns; at four it widens. The count is arithmetic and has no algorithm in it.

An image does not determine the light

A photograph of a scene under one illuminant gives three numbers per surface and asks for the illuminant plus three numbers per surface. The count closes only if reflectances lie in a two-dimensional model, and no number of surfaces helps — at three dimensions the alternative scenes can be written down, and they reproduce every sensor response exactly.

scene · Scene
A camera matrix fitted under each light, used under each light. Mean ΔE00 over the same surfaces, with the matrix fitted under the row's light and the scene under the column's. The diagonal is what a profile's data sheet quotes and is between 1.0 and 1.2 everywhere. Off it the numbers rise steeply: the matrix fitted under illuminant A reports 1.17 there and delivers 9.34 under a 9000 K daylight, a factor of 8.0. Nothing about the camera changes between cells.

A matrix is fitted under one light

A camera's colour matrix is nine numbers determined by a chart photographed under a particular illuminant, and the error it quotes is the error under that illuminant. Fitted under a tungsten lamp and used under a cold sky it delivers eight times as much — and the two-matrix scheme every real profile uses turns out not to be a compromise at all.

imaging · Capture
The dyes a camera has, and the dyes an adaptation basis would want. Three sensor sensitivities drawn twice: faintly, the silicon-and-filter-array set this collection models, and boldly, three Gaussian dyes chosen to make the inverse of their own response matrix a good basis for a white-balance gain. The designed dyes sit at 610, 542, 449 nm with widths of 35, 26, 30 nm — narrower and further apart than the real ones, which is what sharpening looks like when a search rather than a committee does it. They leave 0.97 ΔE00 against the real sensor's 1.62, and they are held within 0.28 of the Luther condition so that the result is still a camera.

A sensor designed for its inverse

A camera's white balance is a gain in a basis made from its own dyes and the light in the room. Choose the dyes for that basis instead of for cost and quantum efficiency, hold the sensor within a stated distance of the Luther condition, and the design reaches the best adaptation figure any basis achieves — and then the room moves it.

imaging · Capture
Four cameras that all satisfy the Luther condition exactly. Four sensors whose sensitivities are linear combinations of the colour-matching functions — the theoretical ideal, satisfying the condition to machine precision, each with an adaptation basis that does not move when the light does. They differ only in which linear combination, which the condition does not constrain, and they leave 2.46, 0.97, 1.65, 2.37 ΔE00 after a white balance. The best of them reaches 0.974, which is the best any basis at all achieves. Being a perfect colorimeter costs nothing in adaptation; what costs is the mixing matrix, and the control measured here carries one nobody chose.

The condition chooses no axes

It has long been said here that a sensor satisfying the Luther condition exactly adapts worse than a silicon one, and offered a reason — that its channels are the matching functions, and a gain on those is the oldest mistake in the subject. The measurement was of one sensor. The condition leaves the axes entirely free.

imaging · Capture
Three exchanges, two of which move the colour. The documented pipeline is a white balance, a colour matrix, a tone curve and a clip. Each bar is what happens when two neighbours change places, over 30 surfaces the modelled sensor captures: the filled bar is the mean and the tick is the worst patch. Exchanging the balance and the matrix costs 9.2 colour differences at the mean and 13.2 at the worst. Exchanging the curve and the clip costs exactly nothing, and that is a theorem rather than a small number: a monotone curve onto the unit interval commutes with clamping to it.

The order is not in the documentation

A raw converter performs a white balance, a colour matrix, a tone curve and a clip, and every account of the process lists them in that order without saying the order decides anything. Exchanging the first two moves the picture by nine colour differences at the mean and thirteen at the worst patch. The twenty-four arrangements collapse into five outcomes running out to sixty-five, and nothing a converter ships says which of them it is.

imaging · Capture
One infrared-cut filter, crossed at four angles. The transmittance of the same interference filter for light crossing it at the centre of a frame and at three steeper angles, from 560 to 760 nm. Its half-transmission edge is at 665 nm straight on and moves to 658, 646 and 630 nm, following the edge wavelength times the square root of one minus the squared sine of the angle over the square of the stack's effective index, 1.8. The deepest reds are what it takes away, and a lamp decides how much light there was in them.

The corner of the frame has another filter

A camera's infrared-cut filter is an interference stack, and light crossing it at an angle sees its edge moved towards the blue — from 665 nm at the centre of a frame to 646 at twenty-five degrees. The corner's red channel loses a tenth of its response under daylight and a sixth under tungsten. A grey-card gain map makes the corner exactly right under the lamp it was made under; under a tungsten lamp the same grey is 2.6 colour differences wrong, under a white LED 4.2, and even under its own lamp the coloured patches are not corrected, because a moved edge is not a gain.

imaging · Capture
A black level slightly wrong, through the balance, under daylight. A grey ramp from half a per cent to seventy-two per cent reflectance, with a pedestal error of a tenth, three tenths and one per cent of white left in all three raw channels before the white balance, against the same ramp with none. The horizontal axis is the grey's reflectance, logarithmic. At a three-tenths error a two per cent grey is 2.4 colour differences off, most of it chroma, and a seventy-two per cent grey 0.21. An equal offset in the raw channels is not equal after three different gains.

A black level is multiplied by the balance

Every raw value carries a pedestal that is subtracted before anything else, and a white balance is then a different gain in each channel. Subtracting a constant and multiplying by one commute only when the constant is zero or the gains are equal. So a pedestal left three thousandths of white too high becomes 2.4 colour differences in a two per cent grey, most of it chroma, in the colour the lamp starves — and pushing that shadow four stops in editing makes it 8.9. An offset in proportion to the lamp's own white is the exception, and it is exactly grey.

imaging · Capture
Noise clipped at zero, averaged over a shadow, under tungsten. A grey ramp from black to ten per cent reflectance under tungsten, captured at three illustrative noise levels, with every negative raw reading set to zero before the readings are averaged over an area. Each line is the colour difference between that average and the noiseless grey. At high gain a half per cent grey is 1.04 off and a black frame 0.79; at very high gain the worst is 2.95, at 1.0 per cent. The same readings averaged before any clip come back exactly, at every level. The tint is gone once every channel sits several deviations above zero.

Clipped noise does not average away

Noise on a raw reading is as likely to fall below the true value as above it, which is why averaging an area removes it. A converter that sets negative readings to zero keeps the upper half and throws the lower away, and the mean of what is left is the signal plus a pedestal. With no black level error anywhere, a half per cent grey under a tungsten lamp comes out 1.04 colour differences off at high gain, 8.98 after a four-stop push — and a blur that removes every trace of the noise leaves the tint where it was.

imaging · Capture
Three corrections for the corner of a frame, each made under daylight. The mean colour difference over twenty-four coloured patches between the centre of a frame and its corner, against the angle light arrives at, after three corrections each fitted under daylight, D65 and used under it: a grey-card gain map, a correction confined to the red channel's row, and a full three-by-three matrix. All three leave the grey exact. At 25° the gain map leaves 1.86, the red row 0.93 and the matrix 0.90; at 35°, 3.81, 1.95 and 1.81. Six more numbers buy almost nothing, because the moved edge is in one channel.

A corner is corrected by one row

A grey-card gain map makes the corner of a frame exactly right on grey and leaves coloured patches 1.86 colour differences wrong at twenty-five degrees. A three-by-three matrix fitted at that position halves it — and six of its nine numbers do nothing, because the moved filter edge is in one channel. The three that matter rebuild the lost red from green and blue, they carry to another lamp better than a gain map in eleven cases of twelve, and in the twelfth, a row fitted under tungsten and used in daylight, they leave the grey 9.2 off.

imaging · Capture
Two matrices blended by colour temperature, under fourteen lamps. For each lamp, with the neutral held exact as a converter holds it: the mean colour difference over twelve test surfaces with a matrix fitted under that lamp (the short bar) and with the tungsten and daylight matrices blended at the weight its correlated colour temperature gives (the long bar). Smooth lamps on or near the locus sit within 6 per cent of their own matrix. The lamps with lines or narrow bands in them sit a median of 2.2 times theirs, from 1.38 for a broadband tube to 5.2 for a three-emitter source.

Two matrices do not reach a white LED

A camera profile's two matrices, blended by the scene's colour temperature, are as good as a matrix fitted anywhere along daylight. Under a white LED or a fluorescent tube the same blend leaves colours twice as far off as a matrix fitted under that lamp, and no weight inside the profile's range repairs it. What decides it is not how far the lamp sits from the Planckian locus — a triphosphor tube sits nearly on it and fares worst — but whether its spectrum has lines in it, which a white balance reading cannot see.

imaging · Capture
Four ways to fill in a clipped highlight: a glossy surface with a reflection of the lamp, under tungsten. Twenty-four chart surfaces under tungsten, as a glossy surface with a reflection of the lamp, taken up a ramp until their raw channels reach the sensor's ceiling. Each line is the mean colour difference, at equal lightness, between the true colour and what one response to the clipped reading makes of it: clipping to white, carrying the clipped values through, filling the clipped channel from the surface's own ratio, and filling it from the surface's colour plus the lamp's. At 0.4, where most surfaces have one channel clipped, the four leave 5.87, 4.37, 5.56, 0.00; at 2, 2.90, 26.97, 8.18, 8.18.

Filling in a highlight is a claim about the surface

A converter that rebuilds a clipped channel has to say what the highlight was. A matt surface over-exposed keeps its own colour, and filling the lost channel from that colour is exact. A glossy highlight is the surface's colour plus a reflection of the lamp, and the same fill leaves it 7.6 colour differences too colourful — while a fill that solves for surface and lamp is exact. Neither works once two channels are clipped, and a tungsten lamp keeps a highlight in the one-channel band more than twice as long as daylight does.

imaging · Capture
The four places a clamp could sit are two pipelines. Every pair of clamp positions, with the largest difference their delivered values reach over a grid of raw inputs that includes negative ones. Two of the six are exactly zero: a clamp at zero commutes with the white balance, which is a positive scale applied channel by channel, and with the tone curve, which is monotone and fixes zero. It does not commute with the colour matrix, which is the only step that mixes the channels — so the four positions collapse to two, before the matrix and after it, and no measurement of any scene can say more than which side a converter is on.

Four places to clamp are two pipelines

The essay on clipped noise ended on a procedure: a black frame and a dim grey card at a high amplification would place each raw converter's clamp. A procedure is a claim that a measurement identifies something, and this one identifies less than it looks. A clamp at zero commutes with the white balance and with the tone curve and not with the colour matrix, so the four positions are two pipelines — and the measurement separates them, on a card at half a per cent of white rather than on the black frame.

imaging · Capture
The same chart in two studios and in the room that holds both lamps. Each of the chart's twenty-four surfaces, with the pixels its slide needs at two standard deviations at high gain, on a logarithmic scale. Lit by a 3000 K radiator alone the worst surface needs 16,194; lit by daylight at 6500 K alone, 139,574. Lit by both, 50 and 50 per cent of the light, with a highlight of each lamp read together, the worst needs 10 and the median 6. The studios' hard surfaces sit at different places on the chart, and no surface is hard in both.

Two lamps decide what one lamp could not

Under one lamp a handful of surfaces cannot tell a glossy highlight from a matt over-exposure without most of a frame, because there the two differ by a scale a ratio cannot see. In a room lit evenly by a 3000 K lamp and daylight, every surface on the chart is decided from ten pixels. A body can sit at one lamp's white, not at two, and the rescue holds only while the second lamp carries a fifth of the light and its white sits far enough from the first.

imaging · Capture
Four ways to correct the corner, under each of four lamps, at 25°. The mean colour error left on the chart's coloured patches at the corner of the frame, under each lamp, after: the red row fitted under that lamp; one red row fitted on the chart under all four lamps with the grey held under daylight; a grey-card gain map calibrated under daylight; and the worst of the other lamps' rows used by mistake. daylight: 0.93, 1.33, 1.86, 4.91; tungsten: 0.99, 1.45, 1.87, 3.26; white LED: 0.36, 1.39, 3.28, 1.77; fluorescent: 0.37, 1.56, 3.09, 2.45. The pooled row holds every lamp between 1.33 and 1.56.

One row for every lamp costs the lamps that lose least

A corner correction fitted under one lamp is right under that lamp and can be badly wrong under another, so a converter unsure of its lamp was offered a single row fitted under several at once. Pooled over four lamps, one row holds every lamp's corner between 1.33 and 1.56 colour differences — no lamp worse than a grey-card map, and none near the 4.91 a wrong row can leave. The price falls on the white LED and the fluorescent tube, which it leaves four times worse than their own rows, because they lose the least red at the corner and the pooled row is built to repair the lamps that lose the most. Two rows, one per class of lamp, keep almost all of both.

imaging · Capture

Named alongside it

The objects these essays reach for when they reach for this one.

Camera rawColour matrixIlluminantSpectral sensitivityLuther conditionChromatic adaptationIdentifiabilityCalibrationClippingColour managementThe von Kries transformAdaptation

All concepts