sRGB Values and Light Intensity

April 10, 2011

A digital image consists of tiny color patches next to each other. Each patch is called a pixel and its color is stored as a number. How each number for an individual pixel is interpreted as a color is determined by the image’s color space. The most common color space for digital images is sRGB. It was created in 1996 to match typical CRTs and has since become the default color space for digital images. But without the awareness of color spaces, the number for each pixel is easily interpreted as light intensity. If a creator of image editing software makes this mistake, it results in incorrect image editing.

Using software that handles images incorrectly does not necessarily mean that the result is worse. It may actually be preferable. The final decision of whether one image is better than another is made by the viewer.

sRGB Gray Scale

An image using the sRGB color space uses more numbers to represent darker colors than a color space that directly stores light intensity. This is a closer match to how us humans perceive differences in color. The difference can be seen in the following images.

Gray gradient using sRGB values.

The sRGB gray scale.

Gray gradient using light intensity.

The gray scale by light intensity.

Gray gradient using CIE 1976 L*a*b* values.

The CIE 1976 L*a*b* gray scale. The CIE L*a*b* color space was created with the goal to match human perception.

Thus if a piece of image software interprets an sRGB value as linear intensity it will treat it as brighter than it actually is. This may have a perceivable effect on their result for some techniques.

Image Editing

The number of image editing techniques that exists is huge. To test even a significant part is insurmountable. What follows is two comparisons. Both using the same test image.

Original image.

The image used to compare editing techniques.

Gaussian Blur

Gaussian blur is used to soften an image. It reduces noise, but can also remove interesting details. Applying Gaussian blur to the test image produces the following results.

Gaussian blur using sRGB values. Gaussian blur using light intensity.

Left: Image is processed using sRGB values. Right: Image processed using light intensity.

The difference require some effort to perceive. The image processed using light intensity is slightly softer, especially where light and dark colors are next to each other. E.g. at the edges of the petals.

Lanczos5 Upscaling

One technique to resize images is Lanczos resampling. Resizing the test image to 190% of its original dimensions produces almost identical results when using sRGB values and light intensity. The results are shown below.

Lanczos5 upscaling using sRGB values. Lanczos5 upscaling using light intensity.

Left: Image is processed using sRGB values. Right: Image processed using light intensity.

Conclusion

Performing image editing on sRGB values instead of light intensity may alter the results. Whether this is an error or an alternative way to edit images has to be decided in each case.

© 2024 Mats Mattsson