skip to main content

Limitations of unbounded sRGB as a universal color space for image editing

Unbounded sRGB can be used to encode and display any RGB color. Nonetheless, unbounded sRGB is not suitable for use as a universal, "one size fits all" color space for image editing (and neither is any other predetermined RGB working space, bounded or otherwise). Many editing operations are chromaticity dependent, giving different results in different RGB working spaces. So choosing the right working space for the task at hand is the photographer's first, and critically important, technical and artistic decision.

Written May 2014; updated January 2016.

Introduction: Unbounded sRGB as a universal color space for image editing

If an ICC profile conversion from a source RGB color space to a destination RGB color space is done using floating point precision, and if the destination color space profile's tone reproduction curve meets certain minimal conditions, then LittleCMS's unbounded ICC profile conversions allow an RGB image to be converted from the source to the destination color space without clipping any out of gamut colors. Clipping is prevented by allowing the converted out-of-gamut colors to have at least one and possibly two RGB channel values that are less than 0.0. The remaining channel value(s) must be greater than 0.0 and might be greater than 1.0.

When doing an unbounded ICC profile conversion, the destination color space's color gamut is also effectively unbounded. The most popular unbounded color space is unbounded sRGB (also called "extended sRGB"). However, testing shows that unbounded sRGB is not suitable for use as a universal working space for (at least) the following reasons:

  1. Many editing operations are chromaticity dependent, including the critically important operations of multiplying/dividing by a non-gray color.

    These operations produce different results in different RGB working spaces (even if all the image colors are in gamut with respect to both working spaces), in which case only the artist or photographer can decide which results are preferable and/or technically correct. This consideration applies to any proposed universal RGB working space, whether bounded or unbounded.

  2. Editing operations involving multiplying and dividing by a color produce physically impossible and mathematically meaningless results when performed on out of gamut colors.

Nothing in this article should be taken to mean that unbounded color spaces are not useful for editing. Indeed unbounded color spaces (including the unbounded sRGB color space) are very useful for editing. But out of gamut channel values do need to be used appropriately.

When editing images, the working space chromaticities do matter

Chromaticity dependent and chromaticity independent editing operations:

Results of editing operations of course depend on the RGB working space Tone Reproduction Curve ("TRC"). Radiometrically correct results require using the linear gamma TRC. Comparing the results of editing the same image in different linear gamma RGB working spaces reveals that:

  • Some editing operations are chromaticity independent editing operations and will produce exactly the same result in any linear gamma unbounded (or bounded, if all the image colors are in gamut) RGB working space.
  • Some editing operations are chromaticity dependent editing operations and will produce different results depending on the RGB working space chromaticities.

High bit depth GIMP 2.9 from git is somewhat unusual among RGB image editors in that it actually can be used to edit images in the unbounded sRGB color space. So I used GIMP 2.9 to prepare the table and examples that follow. The default GIMP 2.9 from git uses linear gamma RGB values for some editing operations and uses "gamma corrected" RGB values for other editing operations. To avoid any accidental "apples to oranges" comparisions, I compiled and used a version of GIMP from git that I modified to ensure that all editing operations were done using linear gamma processing, and I removed clipping code from selected editing operations to avoid having out of gamut channel values clipped.

To determine which editing operations are chromaticity dependent and which are chromaticity independent I made a composite image from crops taken from colorful interpolated camera raw files. Then I applied selected editing operations to the composite, first in a custom working space based on the camera input profile (so by definition no colors were clipped) and then after converting the composite to unbounded sRGB. I used the entirely "low tech" method of just looking to see which editing operations produced visually identical results and which produced visually different results. So it's possible that some of the editing operations that I marked as "chromaticity independent" really did produce different results in the two different RGB working spaces, but the differences weren't visually obvious.

Table of chromaticity dependent and independent editing operations

Table 1 below shows which editing operations produced visually obvious differences in the two RGB working spaces (the "Dependent" column is checked), and which produced visually identical results (the "Independent" column is checked). The "Addition" Blend mode table entry is linked to a demonstration of the fact that addition really is a chromaticity independent editing operation. The remaining table entry links will take you to worked examples and discussions of problems that arise when attempting to use unbounded sRGB as a universal working space:

Table 1: Chromaticity dependent and independent RGB editing operations
Category Operation Dependent Independent
Blend modes Addition X
Blend modes Burn X
Blend modes Color X
Blend modes Darken only X
Blend modes Difference X
Blend modes Dissolve X
Blend modes Divide X
Blend modes Dodge X
Blend modes Grain extract X
Blend modes Grain merge X
Blend modes Hard light X
Blend modes Hue X
Blend modes Lighten only X
Blend modes Multiply X
Blend modes Normal X
Blend modes Overlay X
Blend modes Saturation X
Blend modes Screen X
Blend modes Soft light X
Blend modes Subtract X
Blend modes Value X
Channel data Using channel data as an editing layer X
Channel data Channel-based selections X
Colors Alien Map HSL or RGB X
Colors Auto strech contrast X
Colors Auto stretch contrast HSV X
Colors Brightness/Contrast X
Colors Channel Mixer X
Colors Color Balance X
Colors Colorize
Colors Curves, RGB channels X
Colors Curves, Value channel X
Colors Desaturate average X
Colors Desaturate lightness X
Colors Desaturate luminosity X
Colors HDR Exposure, exposure and offset X
Colors HDR Exposure, gamma X
Colors Hue-Lightness-Saturation X
Colors Invert Colors X
Colors Levels RGB channels, upper/lower sliders (See Figure 2 below) X
Colors Levels Value Channel, upper/lower sliders X
Colors Levels gamma slider adjustments, RGB and Value channels (Also see Figure 1 below) X
Colors Mono Mixer, straight luminosity X
Colors Mono Mixer, anything except straight luminosity (See Figure 3 below) X
Colors Threshold X
Colors Posterize X
Colors Value Invert X
Filters Apply lens X
Filters Artistic Cartoon X
Filters Artistic Soft glow X
Filters Edge Detect difference of gaussians X
Filters Edge Detect Laplace X
Filters Edge Detect Sobel X
Filters Emboss X
Filters Gaussian Blur X
Filters Lens distortion X
Filters Noise Pick X
Filters Noise RGB X
Filters Noise Slur X
Filters Noise Spread X
Filters Pixelize X
Filters Red Eye Removal X
Filters Tile Seamless X
Filters Unsharp mask X
Filters Vignette - black, white, gray X
Filters Vignette - color X
Paint Tools Normal, etc blend modes X
Paint Tools Multiply, etc blend modes X
Tools/gegl op High Pass X
Tools/gegl op Mantuik06 X
Tools/gegl op Mirror X
Tools/gegl op Radial Gradient X
Tools/gegl op Box Max X
Tools/gegl op Box Min X
Tools/gegl op Fattal2 X
Tools/gegl op Gaussian blur X
Transforms Crop X
Transforms Flip X
Transforms Rotate X
Transforms Scale X
Transforms Other transforms X

Table 1 above is not exhaustive but rather reflects my effort to pick out the more photographically important editing operations and also hit a sampling of the remaining operations.

Of the 82 operations listed in Table 1, 47 operations (57%) are chromaticity dependent, meaning the results of the operation will be visually different, depending on which RGB working space was used to perform the operation. The remaining 43% are chromaticity independent, meaning the operation produced visually identical results in both color spaces.

Here are some of the more important chromaticity independent editing operations:

  • The Normal, Addition, Subtract, Grain Extract, and Grain Merge layer blend modes (Grain Extract and Grain Merge are very useful GIMP blend modes that aren't found in all image editors).
  • The Levels Value Channel upper and lower sliders.
  • Gaussian blur and Unsharp Mask.
  • Scaling Images and probably most or all other transform operations (rotate, etc).
  • Painting and drawing gradients using the Normal blend mode.

For these and all other chromaticity independent editing operations, as long as the editing is done in a linear gamma RGB working space, and unbounded ICC profile conversions are used to prevent gamut clipping, and any clipping code in the relevant editing operations is removed, the chromaticities of the RGB working space are entirely irrelevant: any RGB working space will produce exactly the same results.

Here are some of the more important chromaticity dependent editing operations:

  • Channel-based operations such as using channel information as a blending layer.
  • Adjusting the Levels gamma slider, whether the Value, Red, Green, or Blue channel slider
  • Curves
  • Adjusting the Levels Red, Green, or Blue channel upper or lower sliders independently, as one might do to color balance an image
  • The Multiply and Divide blend modes, and any blend mode that uses multiplication or division (Soft Light, Hard Light, Screen, etc)
  • The Hue, Saturation, Color, and Value blend modes and any editing operation that makes use of Hue, Saturation, Color, and Value information.

For these and all the other chromaticity dependent RGB editing operation, the RGB color space that's chosen to be the data container for image editing makes a difference in the results of the operation. Accordingly, it behooves the artist to choose and use the right RGB working space for the task at hand. Examples below show examples of image editing operations that flat out fail when done in the unbounded sRGB color space:

Examples of editing operations that fail in unbounded sRGB

Figures 1, 2, and 3 below show examples of wrong results from editing larger gamut images after converting them to the unbounded sRGB color space:

A Levels gamma slider adjustment is a chromaticity dependent editing operation:
  • Extreme Left: A photograph of a bright red show vehicle, shot raw, interpolated, and output in a linear gamma version of the ProPhotoRGB color space.
  • Middle: After giving the image a Levels Gamma slider=3.00 adjustment while still in the linear gamma version of the ProPhotoRGB color space. The image is lighter and less saturated, exactly as expected.
  • Extreme Right: After converting the image to unbounded linear gamma sRGB and then giving the image a Levels Gamma slider=3.00 adjustment. The red car is now a very saturated magenta and the chrome bumper turned cyan blue.

The unbounded sRGB color space is a terrible color data container if you intend to make a Levels gamma slider adjustments on saturated colors that were originally in the ProPhotoRGB color space.

The original photograph of the red show vehicle on the extreme left was kindly provided by photographer Scott Miller.

Color correcting an image is a chromaticity dependent editing operation:
  • Extreme Left: The picture has an extreme green color cast that needs to be corrected.
  • Middle: After color correction in the ProPhotoRGB color space.
  • Extreme Right: After color correction in the unbounded sRGB color space.

Generally speaking, radiometrically correct editing results require that the operation be done in a linear gamma color space. The goal is to compare results while editing in two different linear gamma color spaces: linear gamma unbounded sRGB and linear gamma ProPhotoRGB. As the original image was output in the regular ProPhotoRGB color space with its gamma=1.80 tone reproduction curve, the first step was to convert the original image to a linear gamma version of ProPhotoRGB.

A time-honored way to test how well an editing algorithm works is to deliberately mess up a known good image and then see how well the algorithm works to repair the damage. The images above show the results of testing whether an image that is improperly white balanced in the ProPhotoRGB color space can be color corrected in the unbounded sRGB color space (the answer is no).

  1. Above on the extreme left: While still in the linear gamma version of the ProPhotoRGB color space, I put a solid white "white balancing" dot on the fender next to the right headlamp of an image that was already correctly white balanced during raw processing (it looked like the center image except without the white dot). Then I used the Levels sliders to reduce the intensity of the red and blue channels, thereby giving the originally correctly white balanced image a green color cast.

    Can the image be successfully color-corrected in the ProPhotoRGB color space (yes, see the center image) and also in the unbounded sRGB color space (no, see the image on the extreme right)?

  2. Above in the center: As expected, while still in the linear gamma version of the ProPhotoRGB color space, using the Levels white balance eyedropper on the "white balancing" dot next to the headlamp immediately restores the original image colors.
  3. Above on the extreme right: I converted the image on the extreme left to unbounded linear gamma sRGB and used the Levels white balance eyedropper on the "white balancing" dot. As one would expect, the dot did turn white, but all the other colors are out of balance. As the close-up crop to the right shows:
    • The grass changed to a nasty shade of cyan-green and is too saturated.
    • The yellow stripe on the grass is more saturated.
    • Skin tones turned more orange and more saturated, as did the red truck in the distance on the left edge of the photograph.
    • The sky and the man's pale blue shirt both turned to saturated cyan-blue.
    • Less obvious, but the precise shade of blue of the show vehicle is also altered as the blue has moved slightly towards magenta and is also more saturated.

Color correcting an image requires that you choose the correct RGB working space in which to make the color corrections. If you are trying to color correct an interpolated raw file that was output in the ProPhotoRGB color space, don't convert it to unbounded sRGB before color correcting it!

The original (and correctly white balanced!) photograph of the blue truck was kindly provided by photographer Scott Miller.

Except in the limiting case of doing a strict luminance-based conversion to black and white, using Channel Mixer (GIMP's Mono Mixer) to create a monochrome image is a chromaticity dependent editing operation:

Let's say a restaurant owner wants a print of a photograph of a nicely restored yellow truck to hang on a wall in his restaurant. He wants the print to emulate old black and white prints made from orthochromatic film that was very sensitive to blue light and only a little sensitive to red, yellow, and green light.

  • On the left, the photographer used a linear gamma version of ProPhotoRGB. She used the mono-mixer formula "0.00/0.00/1.20" to produce the base conversion to black and white from which the final print was made.
  • On the right, the photographer chose to work in the unbounded sRGB color space. Consequently the blue channel detail was negative over most of the bright yellow truck. Consequently and despite tedious trial and error, there was no satisfactory way to emulate orthochromatic film.

Which version of the print do you think the hypothetical restaurant owner will want to display in his restaurant?

The original photograph of the yellow truck was kindly provided by photographer Scott Miller.

Conclusion: Unbounded sRGB is not suitable for use as a universal color space for image editing

Unbounded sRGB: good for displaying images, terrible as a universal color space for editing images

For a software developer who is considering using the sRGB color space as the universal color space for image editing, the question to be asked and answered is "Do the sRGB chromaticities have any special property such that chromaticity dependent operations produce especially desireable, aesthetically more pleasing, or radiometrically more correct results when done in the unbounded sRGB working space instead of some other working space that the artist or photographer might prefer to use?"

The answer is "Of course not." The only virtues possessed by the sRGB chromaticities are (1)the sRGB color space more or less adequately described the display characteristics of consumer grade CRT monitors from the 1990s and (2)for historical reasons the sRGB color space was enshrined as the standard color space for non-color-managed images and web browsers. Assuming the operating system has appropriate hooks, unbounded sRGB does make it possible to display wider gamut images on today's wider gamut displays, while still using the sRGB chromaticities. The benefit, of course, is that consumers thereby continue to avoid the complications of dealing with ICC profile color management.

However, displaying an image is not the same as actually editing an image. Many editing operations will produce exactly the same results in any unbounded linear gamma color space. But many other editing operations produce erroneous results that range from mildly puzzling to flatly unuseable, depending on the operation, the image colors and the source color space chromaticities. These errors are both cumulative and proportional, with larger errors being produced by more extreme edits on more saturated colors that originated in color spaces with very different chromaticities than the sRGB chromaticities.

More information about unbounded sRGB as a universal working space

For more information about the pitfalls of attempting to use an unbounded RGB color space as a universal working space, see:

  1. Multiplying out of gamut colors in the unbounded sRGB color space produces meaningless results
  2. Color correction fails in unbounded sRGB

The above two articles focus on specifically on unbounded sRGB, but of course the same considerations apply to any attempt to use a predetermined RGB working space as "the" RGB working space.