Concept

Gamma — where it appears

The exponent relating a code value to a luminance, historically the response of a cathode-ray tube and since kept because it distributes quantisation steps usefully. The encoding and decoding exponents differ deliberately, which adds contrast in a dim viewing room.

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

A gamma probe: which grey matches a half-white dither?. The striped block on the left is half white and half black, so it carries half the luminance of white. Stand back until the stripes blur and find the patch that matches it. On an sRGB display the answer is code 188, not 128 — code 128 has only 22 per cent of white's luminance.

The display is an unknown

This site is displayed on the very apparatus it is about, and it knows almost nothing about that apparatus. Two figures here stop assuming and ask instead — a probe for the transfer function and a probe for the gamut.

limits · Limits
The sRGB transfer function, and the gamma 2.2 curve it is not. Code value against relative luminance. The sRGB function is piecewise — a short linear segment near black, then a 2.4 power law with an offset — and it is close to but not the same as a plain 2.2 power law. Half-way along the axis of stored values sits at 21 per cent luminance, and half the luminance of white is at code 188.

The midpoint is not half

Code 128 sits halfway along the sRGB scale and carries about a fifth of white's luminance. Half the luminance is code 188. Almost every gradient, blur and resize on the web gets this wrong, and the errors are visible once known.

difference · Metric
One edge magnified four times, three ways: text on a page. A step between the two colours of text on a page, magnified four times by linear interpolation, by bicubic and by a three-lobe Lanczos kernel, once on the stored values and once on the light. The curves are the stored-value result's lightness minus the light's, sample by sample across the edge; below the line the stored-value resize is darker. Linear interpolation is darker everywhere it differs. The two kernels with negative lobes swing above the line beside the edge, where their negative weights fall — bicubic by up to 1.8 colour differences and Lanczos by 3.7.

A resize with a negative weight in it

A blend taken on stored values is always darker than the blend of the light, because the encoding is concave and a convex combination of a concave function's values lies below the function of the combination. A bicubic or Lanczos resize is not a convex combination. Beside an edge its negative weights make the stored-value result lighter than the light's own — by up to 6.1 colour differences with bicubic and 12.2 with Lanczos on skin against its shadow — and on edges between full-scale values the clip hides the overshoot and the old guarantee appears to hold.

applied · Delivery
The corner of a patch of skin against its own shadow, magnified four times by Lanczos, three lobes. A map of the neighbourhood of one corner of a square patch — the patch fills the lower right, the field the rest — once it has been magnified four times by Lanczos, three lobes. Each cell is shaded by how much lighter (warm) or darker (cool) the stored-value result is than the light's, the deepest shade 18.2 units of lightness. Within three source pixels of the corner the stored-value result is up to 14.5 colour differences lighter, 14.5 outside the patch against 3.1 inside it, and up to 7.3 darker.

The corner of a resized patch is lighter than its edges

A resize taken on stored values is darker than the resize of the light wherever its weights are positive, and lighter beside an edge where a kernel's negative lobes fall. In two dimensions the kernel is a product, and just outside a patch's corner a Lanczos magnification of skin against its shadow comes out 14.5 colour differences lighter — more than along either edge. A reduction to a quarter is mostly an average and errs lighter by at most two. And an unsharp mask, whose negative weights are its whole purpose, is lighter on the stored values at every amount on every pair, and never darker.

applied · Delivery
Where an unsharp mask errs, per pixel and as seen: print, 40 cm. The upper-left corner of a patch of skin against its shadow after an unsharp mask, as two maps of the colour difference between the result taken on stored values and taken on light. Left, pixel by pixel: the corner peaks at 16.8 and the middle of the edge at 16.6. Right, after the eye's three spatial channels at a print at 40 cm: the corner is seen at 17.1 and the edge at 7.1, a ratio of 2.40. Darker is larger, on one scale for both maps.

The eye counts a corner's error, not its peak

A Lanczos-magnified patch errs a fifth more at its corner than along its edges, pixel by pixel, and an unsharp mask errs almost exactly as much at its corner as along its edges. Filtered by the eye over the plane rather than along a line, the two swap: the magnified corner is seen exactly as its edge is, and on a printed page the sharpened corner is seen at 2.4 times its edge. What decides it is whether the error changes sign. Ringing averages away and a one-sided halo does not, and a corner is where two edges' halos land on the same patch of retina.

applied · Delivery
Where a sharpened E errs, per pixel and as seen: black type on paper, 10 point. The letter E at 10 point on a 300-dot-an-inch page, black type on paper, sharpened by an unsharp mask on stored values and on light; the two maps show the colour difference between the results, pixel by pixel on the left and after the eye's three spatial channels at 40 centimetres on the right, on one scale. The thin line is the letter's outline and the dashed circles mark two pixels round each corner — 8 outer corners and stroke ends, 4 inside angles. The circled zones are 31% of the outline and hold 28% of the per-pixel error and 25% of the seen error.

Sharpened type errs on its dark side

A sharpened square hides its halo along its edges and shows it at its corners, so a sharpened page of type was predicted to show its error at the corners of its letters, several times out of proportion to their length. Black type does the opposite: its outer corners and stroke ends hold between two thirds and nine tenths of their share. As the eye leaves it, the error lies on the dark side of every edge, and a corner holds as much of it as it has dark ground around it — a quarter of a disc where a black corner points out into paper, three quarters where black wraps round a pale one.

applied · Delivery

Named alongside it

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

Transfer functionImage differenceColour managementLightnessLinear lightSharpeningSpatial frequencyAliasingClippingContrast sensitivityΔEInterpolation

All concepts