Display metrology · one slider, no instrument

The Exponent Between the Number and the Light

Your screen is handed a number from 0 to 255 and answers with an amount of light. The two are not proportional, and the exponent that ties them together is called gamma. You can measure yours right now, with no instrument at all except the eye you are reading this with. Then the harder half: which part of the gap between your number and the standard's number is your monitor, and which part is your hand.

1One patch, one exponent

The striped block below is half black lines and half white lines, one screen pixel each. Step back, or squint, and the stripes fuse. What they fuse into is genuinely half the light of white, because half the pixels are off, and light adds. That is not a claim about your perception; it is arithmetic about photons leaving a surface.

Underneath sits a flat grey you control. Drag until the seam between them disappears. When it does, you have found the code value that emits half the light, and one division gives the exponent.

The match · stripes above, flat grey below

 

Surround

The sRGB standard assumes a 64 lux room and a surround around 20 per cent reflectance. This page is dark. Switch the surround and watch whether your match moves: if it does, some of your exponent is the room, not the monitor.

Whatever number you landed on, the exponent is ln(1/2) / ln(v/255), and the page has printed it above. The reference display that the sRGB standard describes would have wanted not yet; a pure 2.2 power law would have wanted not yet. One match is not a measurement, though. It is one point, and a single point can be fitted by any curve at all.

2Eight patches, and the residual nobody shows you

Xiao, Fu, Karatzas and Wuerger built the standard version of this task in 2011: eight halftone patches carrying 1/9 through 8/9 of maximum light, matched one at a time. Eight matches, eight points on your display's transfer curve, and a power law fitted through them. The fourth patch is asked twice, first and last, and the difference between those two answers is the only honest estimate of your own precision that exists.

Patch 1 of 9 · halftone at 1/9

 

Your display's exponent

not measured yet

Set at least five patches.

Light against code value. The three thin curves are the sRGB piecewise function, a pure 2.2 power law, and a pure 2.5 power law. Your matches are the dots; the thick line is the exponent fitted to them. All three thin curves are drawn. Two of them are one line at this scale, and which two is section 4 arriving early.
The residual, in code values, patch by patch. A display that were exactly a power law would put every dot on the zero line. None do, including the standard's own curve.

 

Two things fall out of that fit that are worth more than the exponent itself. The first is that a single power law is an approximation even for the standard: run this same eight-point reduction over a display that implements the sRGB piecewise function exactly, and the eight patches return exponents ranging from not yet to not yet, with a best fit of not yet. Not 2.4, which is the exponent written inside the standard's formula, and not 2.2 either.

The second is that the bright patches barely matter. At 8/9 the matched code sits near not yet, and one code value of slop there moves that patch's exponent by about not yet. At 1/9 the same slop moves it by not yet. The dim end of the scale is where the measurement lives. That is why the spread of the eight per-patch exponents is reported here and never used to refuse a run.

The room does not bias this, and that is provable

Stray light landing on the screen, and a black that leaks rather than reaching zero, both add the same constant to every patch: the display becomes L = b + (1−b)·c^γ. Work through a halftone match under that model and the b cancels identically on both sides. The largest code-value shift this page can produce by adding up to 20 per cent flare, across all eight patches, is not yet code values. Poynton's CRT model puts the offset inside the power instead, L = ((c+ε)/(1+ε))^γ, and that one does not cancel: a true 2.5 display with the black level set 5 per cent high reads back as not yet. So a bright room is harmless here and a mis-set brightness control is not, which is the opposite of what most calibration advice implies.

3What your machine will, and will not, tell you

Your browser knows a surprising amount about the panel in front of you and will hand most of it over on request. It will not hand over this.

Read out of your own browser, live

What was askedWhat your machine said

 

There is a place in the hardware where this number is supposed to live. Every monitor ships an EDID block, and byte 0x17 of it is the display gamma, stored as a single byte with γ = (byte + 100) / 100. One byte, so the finest distinction it can draw is 0.01, and it is a value the manufacturer types in rather than one anybody measured.

Here is what that looks like on the machine this page was built on, which has two different monitors plugged into it, one over HDMI and one over DisplayPort. The colour daemon built an ICC profile from each panel's EDID; both files are committed to this repository and both are read back below by the check panel.

PanelConnectionDeclared γProfile SHA-256 (first 16)

 

4The argument your eye cannot settle

There is a real disagreement in colour science underneath all of this, and it is not a misunderstanding that could be cleared up by reading the standard more carefully. IEC 61966-2-1 defines sRGB with a piecewise function: a short straight segment near black, then a 2.4 power with an offset. The same standard describes its reference display as having a CRT gamma of 2.2, or so this page has it at second hand, from ICC's summary of the standard and from the 1996 proposal the standard was made out of; the standard itself is paywalled and this page has not read that clause. Those are two different curves. Poynton, meanwhile, measured actual CRTs and put their exponent near 2.5, with the variation people blamed on the exponent actually coming from black level.

So: which curve is your monitor? Pick two of them and the page will tell you how far apart they are where this instrument can actually look, which is at the eight patches.

A small thing first, because it is the kind of thing that makes a standard feel like a document rather than a law. The published sRGB function does not quite invert itself. The forward threshold is 0.0031308 and the linear slope is 12.92, so the breakpoint on the encoded side is at 0.040449936; the inverse is written with a breakpoint at 0.04045. That leaves a window not yet wide in which the two halves of the standard disagree about which branch applies, and inside it the round trip misses by not yet. Everywhere else it is exact to the last bit a double can hold. Nobody will ever see this; both facts are recomputed in the check panel below.

Two candidate curves, compared at the eight patches

First curve

Second curve

 

How many code values apart the two curves put each match. The dashed band is your own measured scatter, taken from the patch you matched twice.

The result that matters is this. Over the eight patches, the sRGB piecewise function and a pure 2.2 power law never disagree by more than not yet code values, and they yield fitted exponents not yet apart. A pure 2.2 and a pure 2.5 disagree by up to not yet code values, exponents not yet apart. So the second argument is settleable by eye and the first one is not, by a wide margin, and the page will say so in your own units once you have matched the repeated patch twice.

And the verdict is not only about your hand. Section 2 already adds not yet to every exponent this page prints, which is the worst bias any of the 21 committed captures could have put on the answer through the rendering stack alone. That term is larger than the whole sRGB-against-2.2 gap, and repeating the task does nothing to it: repeats shrink the random part as one over the square root of the number of runs and leave a systematic exactly where it is. So for the first argument there is no number of runs, and no steadiness of eye, that would settle it here. For the second there is, which is the only reason this is a measurement of the instrument rather than a slogan.

 

5Half of white is not grey

Here is the consequence, and it is running in the page you are reading. When a browser averages two colours, whether it is blending a translucent layer or shrinking an image, it averages the code values. Half of 0 and 255 is 128. But 128 does not emit half the light of 255. On a display with the exponent you just measured, it emits far less.

The same stripes, shrunk two ways

Left: the stripes. Middle: their average taken in code space, the way a browser takes it. Right: their average taken in light, converted back through your exponent. Step back until the stripes fuse and only one of the two blocks matches them.

 

At a 50/50 mix and an exponent of 2.2, the naive average is code 128 and carries not yet of maximum light where it should carry 50 per cent. The code that does carry half the light is not yet, which is not yet code values away. The naive blend is not yet times too dark, in light.

6When this cannot be measured here

Everything above rests on one sentence: the striped patch carries exactly k/9 of maximum light. That is true only if every pixel in it is either fully off or fully on, and exactly k rows in every nine are on. Anything between the canvas and the glass that resamples the patch breaks it, and the interesting part is how it breaks it. Not by blurring. By quietly changing the fraction while every pixel stays perfectly crisp.

Can this device be measured on, right now?

not measured yet

 

Two things are checked here and one of them is not checkable. The page reads the pattern back out of its own canvas, which catches its own drawing; and it compares the size the pixels were painted at against the size they are being shown at, which catches a page that has been zoomed since it last painted. That second check is a backstop, not the first line: a repaint watchdog already redraws the patch whenever its box changes, so on a working page the stale condition is prevented before it can be detected. The backstop is polled on its own timer rather than only when you move the slider, so that it can still fire when the watchdog does not, which is the state the three captures below were taken in. What no page can do is photograph the screen, so the last stretch, from the compositor to the glass, is bounded by measurement instead of checked.

Before this page shipped, the same nine patches were screenshotted out of a real browser at a run of device pixel ratios, viewport widths and zoom levels, in three different rendering engines, and every pixel of every patch was counted. Those counts are committed, and the table below is produced by running the page's own audit over them, here, now.

Captured tracePurityLight off by, per mille Worth, in γVerdict

 

Two things fell out of that grid, and the second one is the reason the live verdict above says what it says. The first is that a browser can paint this correctly and usually does: not yet of the captures are exact, to the last part in a million, at ratios from not yet to not yet and zoom levels from not yet to not yet per cent. The one capture at a ratio of not yet is not among them: it is the worst non-stale failure in the whole grid, and it is where the bound in the next sentence comes from. The second thing is that the geometry does not tell you which. Of the not yet captures whose box did not sit on whole device pixels, only not yet were actually damaged, and the damage in those never exceeded not yet in the exponent. So the page does not refuse on geometry. It refuses on what it can decide, adds the measured bound to your error bar, and tells you the rest is beyond it.

The five refusals

 

The check, running in your browser

running…

Every row is recomputed here, by the same module that runs the instruments above. If a row is red the page is wrong, not the check. Rows marked OFFLINE: restate a result the browser cannot redo, which is re-derived by node research/the-exponent-between-number-and-light/verify.mjs.