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:
- 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.
- 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:
|Blend modes||Darken only||X|
|Blend modes||Grain extract||X|
|Blend modes||Grain merge||X|
|Blend modes||Hard light||X|
|Blend modes||Lighten only||X|
|Blend modes||Soft light||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||Curves, RGB channels||X|
|Colors||Curves, Value channel||X|
|Colors||HDR Exposure, exposure and offset||X|
|Colors||HDR Exposure, gamma||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|
|Filters||Artistic Soft glow||X|
|Filters||Edge Detect difference of gaussians||X|
|Filters||Edge Detect Laplace||X|
|Filters||Edge Detect Sobel||X|
|Filters||Red Eye Removal||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||Radial Gradient||X|
|Tools/gegl op||Box Max||X|
|Tools/gegl op||Box Min||X|
|Tools/gegl op||Gaussian blur||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
- 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:
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:
- Multiplying out of gamut colors in the unbounded sRGB color space produces meaningless results
- 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.