sRGB specifies a red-green-blue colour encoding. Restricting attention to component values in , its encoded component corresponds to the linear-light component
Thus the conversion is piecewise, not a single power law. The reverse conversion used here is
These conventional rounded thresholds are used by the W3C conversion routines; they give a tiny mismatch at the join rather than a mathematically exact pair of inverses everywhere.[ref][ref]
For an eight-bit neutral grayscale code , use in all three components. Its relative luminance is then . For example, , whereas . This is why averaging encoded values and averaging linear light give different answers. sRGB is a specified interpretation; merely calling a raster image grayscale does not imply it uses sRGB.
For the normalized sRGB calculations here, relative luminance is the linear-light weighted sum
where are decoded linear-light components, not encoded code values. This is the sRGB calculation specified in W3C's WCAG 2.2 definition of relative luminance. It places reference black at 0 and reference white at 1; it does not by itself specify an absolute display light level.[ref]
For a neutral sRGB shade, , and the weights sum to 1, so . For a coloured pixel, relative luminance can be encoded as a neutral sRGB shade with all three encoded components . This preserves the specified while discarding colour differences; it is one precisely defined grayscale conversion, not a unique way to turn all colour images into grayscale.

Articles by others on the same topic (0)

There are currently no matching articles.