Gamma and Perceptual Uniformity: Why 50 Percent Grey Is Not Half as Bright

Two different nonlinearities, one in the display and one in you, and what happens when you forget which is which.

Short answer: an sRGB code value of 128 emits about 22 percent of the light that 255 emits, yet its CIE lightness is about 54, roughly half way up the perceptual scale. That is not a contradiction, it is two separate nonlinearities that happen to nearly cancel. The encoding nonlinearity, gamma, spends code values where the eye needs them. The perceptual nonlinearity, roughly a cube root, is how lightness relates to luminance. Confuse them and you get muddy gradients, wrong blends and a mid grey that is not the middle of anything you meant.

Three different meanings of "half"

Ask for the grey half way between black and white and there are at least three defensible answers.

sRGB codeLight emitted, relative to whiteCIE lightness (L star)What it is the half of
00 percent0Black
645.1 percent27
119about 18 percent50Half in perceived lightness
12821.6 percent54Half of the code range
18850 percent76Half of the light
255100 percent100White

Notice how far apart 119, 128 and 188 are, and how close 119 and 128 look on screen. That closeness is not an accident: the encoding was designed so that the middle of the code range lands near the middle of the perceptual range. It is the light that has been pushed out of shape, and the light is what physics and image processing care about.

Why gamma is there

The usual story is historical. Cathode ray tubes had a naturally nonlinear response, roughly a power law with an exponent near 2.4, so encoding the signal with the inverse power meant a display needed no correction. That is true, and it is not the reason the arrangement survived flat panels.

The real reason is perceptual coding efficiency. Human sensitivity to a small change in light is roughly proportional to the light already present, so a fixed step in the dark is far more visible than the same step in the highlights. A linear code spreads its values evenly across light and therefore wastes most of them where the eye cannot use them, while starving the shadows where it can. Poynton's long-standing treatment of the subject makes the point directly: matching the perceptual performance of an 8-bit nonlinear channel with linear coding takes on the order of eleven bits. Gamma is not a legacy wart. It is compression that happens to have started as physics.

This connects straight to Mach bands and banding. Banding is what you see when the code values run out, and the reason it appears in shadows rather than highlights is exactly this allocation.

The other nonlinearity: how lightness relates to light

Sensation does not grow in proportion to stimulus intensity. Stevens argued in 1957 that perceived magnitude across many sensory modalities follows a power function of physical intensity, with an exponent characteristic of the modality, and for brightness that exponent is well below one. Whatever your view of the details, the qualitative claim is robust: doubling the light does not double the apparent brightness.

The colorimetric version of this is the CIE lightness scale, L star, defined on roughly the cube root of luminance relative to a reference white, with a short linear segment near black to keep it well behaved. It runs 0 to 100 and is constructed so that equal steps are intended to look equally spaced. That is the scale in the table above, and it is the reason 21.6 percent of the light reads as a middle grey rather than a dark one.

Once you have that, a lot of otherwise mysterious behavior becomes predictable. Two swatches that differ by 5 in L star look about equally different whether they sit in the shadows or the highlights, but they differ by very different amounts of actual light, which is why a fixed numeric step in code values does not produce a smooth ramp.

Where it goes wrong in practice

Blending by averaging codes. The midpoint between a code value of 0 and 255 is not 128 in any physical sense. Averaging encoded values averages the wrong quantity, and the result is systematically too dark, most visibly when mixing a saturated color with white. Do the arithmetic in linear light, or in a space built for perceptual interpolation, and the midpoint stops looking muddy.

Resizing and blurring. Any operation that averages neighboring pixels inherits the same problem. Downscaling an image with fine bright detail on a dark ground in encoded values loses brightness that linear-light downscaling preserves.

Alpha compositing. Semi-transparent overlays are averages too, so a 50 percent black overlay does not halve the light unless the compositing is done in linear light.

Gradients. A gradient with evenly spaced code values is even in neither light nor lightness, strictly speaking, though it is much closer to even in lightness. A gradient with evenly spaced linear values looks badly bunched at the top.

Contrast checking. Accessibility contrast ratios are defined on relative luminance, which means the code values have to be linearised before the ratio is computed. Doing it on the raw codes gives a confidently wrong answer, as our page on color contrast and accessibility explains.

"Perceptually uniform" is a goal, not a fact

It is worth being careful with the phrase. CIELAB was designed as a perceptually uniform space and it is a great deal better than working in raw device values, but its uniformity is approximate. Work evaluating the uniform color spaces proposed after CIELAB put the average visual threshold in that space at roughly 2.3 units, while noting that the actual threshold varies considerably across the space. The response of the color science community was telling: rather than replacing the space, the current color-difference recommendation keeps CIELAB and adds weighting functions for lightness, chroma and hue plus a correction term for the blue region. That is a patch, and it is honest about being one.

The lineage of attempts to do better, and what the web finally adopted, is covered in OKLCH and modern color spaces. The short version is that a space can be uniform for small differences or for large ones, for surface colors or for emitted light, and no single space is best at all of them.

What this means for the games

Huetween asks for the color halfway between two others, and everything above is why that question needs a definition before it has an answer. The midpoint in code values, in linear light and in a perceptual space are three different colors. We use a perceptual definition, because that is the one that matches what people mean when they say halfway.

Huespan asks you to reproduce an interval rather than a single color, which makes the choice of scale even more visible: an interval that is constant in lightness is not constant in luminance, and vice versa. Our page on color midpoint and interval perception goes into what that does to the task.

Huesort asks for a smooth ordering, and smoothness is scale-dependent in exactly the same way. A sequence that is even in one space will look slightly bunched in another, which is one reason we do not treat a single misplacement as a real error.

The practical takeaway for a player is smaller than all this theory suggests: keep your display's brightness and any automatic tint adjustment steady, because both of them move the transfer function under your feet, and a shifted transfer function changes which differences are visible at all.

Find out what halfway means to your eye. Huetween shows you two colors and asks for the one exactly between them. Most people are surprised by how far their answer sits from the arithmetic average of the codes.

Play Huetween →

Frequently asked questions

Is an sRGB value of 128 half as bright as 255?

No. Decoded through the standard sRGB transfer function, a code value of 128 emits about 22 percent of the light that 255 emits. Its CIE lightness is about 54, which is roughly half way up the perceptual lightness scale, so it looks like a mid grey while being nowhere near half the light.

Which value does emit half the light?

About 188 in an 8-bit sRGB channel. And the value whose CIE lightness is exactly 50 is about 119. Three different reasonable meanings of the word half give three different numbers, which is the whole reason this page exists.

Why does gamma encoding exist at all?

Historically it matched the response of cathode ray tubes, so no correction was needed at the display. It survived because it is also an efficient perceptual code: the eye is far more sensitive to small differences in dark tones than in bright ones, so spending more code values down there is exactly the right allocation.

How many bits would linear encoding need?

More than eight. The usual figure quoted for matching the perceptual performance of an 8-bit gamma-encoded channel with linear coding is around eleven bits, because linear coding wastes precision on highlights where the eye cannot use it and starves the shadows where it can.

What is CIE lightness?

A scale, written L star, running from 0 for black to 100 for a reference white, built on roughly the cube root of luminance with a small linear segment near black. It is defined so that equal steps in L star are intended to look like equal steps in lightness, which is a much better approximation than luminance itself.

Why is blending two colors by averaging their hex codes wrong?

Because the codes are not proportional to light. Averaging them averages the encoded values, not the light, and the result is darker and often duller than the physical mixture. Convert to linear light, average there, and convert back, or work in a perceptual space designed for it.

Does this affect image resizing and opacity?

Yes, and visibly. Any operation that averages pixels, which includes downscaling, blurring and alpha compositing, gives a different answer depending on whether it happens on encoded or linear values. Fine detail on a bright background is where you notice it first.

Is a perceptually uniform space actually uniform?

Only approximately. Studies evaluating the uniform color spaces proposed after CIELAB found the average threshold in CIELAB to be around 2.3 units, but the real threshold varies substantially by region, which is why the current color-difference formula adds weighting terms rather than trusting the distance.

Keep reading

Sources: Poynton, C., Frequently asked questions about gamma; Poynton, C. (1998), Rehabilitation of gamma, Proceedings of SPIE 3299, 232; Stevens, S. S. (1957), On the psychophysical law, Psychological Review 64(3), 153; International Commission on Illumination, CIE 015:2018 Colorimetry, 4th edition; W3C, A standard default color space for the internet: sRGB; Mahy, M., Van Eycken, L. and Oosterlinck, A. (1994), Evaluation of uniform color spaces developed after the adoption of CIELAB and CIELUV, Color Research & Application 19(2), 105.

Understand it, now train it. The daily games stay free forever. A Personal Pass adds progress tracking (trends + export); Teacher / School tools let you assign it and follow a whole class. For teachers & self-learners →

Updated · By Lajos Toldi — educator and researcher in adaptive intelligent tutoring systems at AI24EduLabs (part of AI24Labs). Scientific claims are checked against authoritative sources; see our editorial policy.
Privacy · Cookies · Terms · About · Contact