Apex › Data & encoding

Why 128 isn’t half-bright (gamma)

A pixel value of 128 emits only about 22% of full light, not 50% — displays are deliberately non-linear, because the eye resolves dark tones better, so images store brightness perceptually (value ≈ light^(1/2.2), sRGB). Half the light is value 188. The consequence: averaging, opacity, resizing, and blur done on raw pixel values are physically wrong and come out too dark; you must decode to linear light first. Real sRGB math, verified: naive average of black+white is 128, the correct one is 188.

More in Data & encoding