Autumn colors: An Introduction to High Bit Depth GIMP's New Editing Capabilities
This tutorial uses high bit depth GIMP 2.9 to increase the Lightness and Colorfulness of a photograph of some autumn foliage against a blue sky, in the process showing how to use GIMP's LCH blend modes to edit separately for color and tonality.
Written October 2015. Updated June 2017.
High bit depth GIMP's new editing capabilities (that you might not have ever used or even heard of before)
An overview of high bit depth GIMP's new editing capabilities
The fact that GIMP is (finally!) a high bit depth image editor means that you can make very complex layer stacks, draw extreme gradients, and work in large color spaces without worrying about posterization and data degradation. But GIMP offers a whole lot more than just high bit depth image editing. GIMP offers new editing capabilities that you might not have used or even heard of before:
- GIMP's new LCH and RGB Luminance blend modes mean that you can put your edits for color in one layer group, and your edits for tonality in a second completely separate layer group, without having to "Make New from Visible" every time you make a change in whichever group underlies the other.
- There should be thunderous applause from the audience for the GIMP developers and contributors who made this possible — separate processing for color and tonality is one of the holy grails of image editing.
- The fact that GIMP provides high bit depth image editing makes it possible to edit in linear gamma RGB working spaces to produce radiometrically correct editing results. Here's why the ability to operate on linear gamma RGB matters to you as an artist or photographer:
- When editing in nonlinear color spaces (for example, the regular sRGB, AdobeRGB1998, and ProPhotoRGB color spaces), most common editing operations produce more or less severe distortions in tonality and color.
For "infographic examples", see:
- Artifacts and hue shifts from Channel Mixer adjustments performed on perceptually uniform RGB.
- Tonality and color shifts from Auto-Stretch Contrast performed on perceptually uniform RGB.
For a more in-depth exploration of gamma artifacts from color mixing in non-linear RGB working spaces, see Linear Gamma vs Higher Gamma RGB Color Spaces: Gaussian Blur and Normal Blend Mode
- Distortions from editing on perceptually uniform RGB carry over to the final image and are so prevalent in images posted to the web that we accept the distortions as normal. But I promise you, once you begin editing in linear gamma RGB working spaces, your eyes will know the difference.
- Speaking of distortions, I suspect that half the "touch-ups" that one might feel compelled to do when editing in a nonlinear RGB color space, are actually attempts to undo damage that was done by editing in a nonlinear RGB color space. The 3D artists switched to linear gamma image editing quite a long time ago for just this reason.
- When editing in nonlinear color spaces (for example, the regular sRGB, AdobeRGB1998, and ProPhotoRGB color spaces), most common editing operations produce more or less severe distortions in tonality and color.
- When editing at floating point precision, many of GIMP's editing operations have been unclamped.
This means that instead of being automatically clipped (like most image editors do), any otherwise out of gamut channel values that might be generated by the editing operations are carried along using floating point RGB channel values that are less than 0.0f and/or greater than 1.0f.
Unclamped editing operations might sound more arcane than interesting, but especially for photographers this is a really big deal:
- Automatically clipped RGB data produces lost detail and causes hue and saturation shifts.
- Unclamped editing operations allow you, the photographer, to choose when and how to bring the colors back into gamut.
- Of interest to photographers and digital artists alike, unclamped editing sets the stage for using high bit depth GIMP for HDR scene-referred image image editing (and already allows for basic HDR editing, though a viewer is desperately needed).
- Speaking of hue shifts (one of the myriad banes that plague editing at integer precision on perceptually uniform RGB), in GIMP you can monitor for changes in Hue, Color, and Lightness using the Color Picker tool and the Pointer and Sample Points dialogs in LCH mode. In addition, of particular interest for digital painting, the LCH Color Picker is useful for making color-space-independent palettes of colors, for example selecting colors to match paint pigments.
Figure 1 below provides a quick overview of what Lightness, Chroma, and Hue mean. The screenshot was taken from CCE before default GIMP had LCH color sliders, and so needs to be updated (CCE's color sliders now look pretty much just like default GIMP's color sliders):
Editing Lightness, Chroma, and Hue separately
Three parameters to describe color
Any way you slice it, it takes three parameters to describe color, except for when it takes five or six parameters — brightness, lightness, colorfulness, chroma, saturation, and hue — in which case the topic is color appearance models.
I'm sure you've heard of RGB, XYZ, LAB, and maybe even LCH, which are the color spaces we'll be taking advantage of in this tutorial:
The XYZ color space is based on experiments that map out the way humans perceive color. All the colors that the average human being can see can be precisely located inside the XYZ color space.
The familiar RGB color spaces (sRGB, AdobeRGB1998, ProPhotoRGB, Rec.2020, etc) are all defined relative to the XYZ reference color space. Unfortunately you can't edit color separately from tonality while working directly with RGB colors because color and tonality are spread out over all three RGB channels.
When we modify tonality we are actually modifying the image's Luminance values. In the XYZ color space, Y holds all the Luminance information, but color information — technically chromaticity — is still spread out over X, Y, and Z.
This is where the LAB and LCH color spaces come in handy: LAB is a perceptually uniform transform of XYZ that separates color into Lightness (which is a perceptually uniform encoding of Luminance) plus red-green and yellow-blue opponent channels (that is, the LAB A and B channels).
In turn, LCH is a polar transform of LAB that separates color into Lightness (the same Lightness as the LAB color space) plus LCH Hue and Chroma.
Why this alphabet soup of color spaces matters to you
Tutorials that show you different methods for making a photograph brighter and more colorful almost always include side-by-side comparisons of how each method produces different results. A major problem with such tutorials is that results are highly unpredictable. The image's resulting Tonality and Color will vary depending on:
- The particular method chosen to increase saturation.
- The color space chromaticities in which the image is processed.
- The color space's particular nonlinear encoding (eg gamma=1.8 for ProPhotoRGB, gamma=2.2 for AdobeRGB1998, the infamous sRGB TRC for the sRGB color space).
Sections C, D, and E of this tutorial shows you step by step how to harness GIMP's wonderful new LCH blend modes to neatly separate editing for tonality from editing for color. Looking beyond the specific editing approach given in this tutorial, knowing the basics of the various color spaces available to you in high bit depth GIMP will enable you to think through to your own creative solutions to the diverse editing problems that present themselves in your digital darkroom, instead of having to continually guess whether "tutorial A", "technique B", or "plug-in C" might be the best way to improve your image.
The final image and some downloadable files for following the steps in the tutorial
Here are the obligatory "before and after" images:
Following along the steps in this tutorial
I heartily recommend actually working through the steps instead of just reading this tutorial: High bit depth GIMP is a radical departure from 8-bit GIMP, and indeed from most image editors, so there's a lot to learn. The tutorial will seem long only because I'm presenting new material. The actual editing steps for replicating the final image can be done in about four minutes, two of which are spent changing layer and group labels.
Here are the preliminary steps to follow:
- Download and unpack the provided 16-bit floating point copy of the "before" image, which is bundled with some Curves presets and some pre-made Layer masks (warning: it's a 3-megabyte file).
If you are new to GIMP, the layer masks are in the downloaded XCF file, under the Channels dialog. To load a given mask, switch to the Channels dialog, right-click on the mask you want, and do "Channel to Selection".
- Open the image and promote the precision to 32-bit floating point.
If you convert to integer precision, many of the editing operations used in this tutorial will clip intermediate editing results. This "integer clipping" will completely defeat one of the goals of the tutorial, which is showing you how to work with out of gamut channel values.
- If you are using default GIMP 2.9, convert the image to GIMP's built-in sRGB color space. If you are using CCE, make sure the image is in the linear gamma RGB working color space of your choice.
The downloaded XCF file is in the linear gamma sRGB color space.
There will be very slight differences in the Chroma of the final image when processed in different linear gamma RGB working spaces because Channel Mixer is a chromaticity-dependent editing operation. Because of how Channel Mixer is used in this tutorial, the differences in the final image won't be noticeable.
- Set up the Lightness, Chroma, and Hue layer groups:
Make three empty Layer groups labelled as shown below. Set the Chroma group blend mode to "Chroma (LCH)". Set the Lightness group blend mode to "Lightness (LCH)". Set the LCH Hue group blend mode to "Hue (LCH)". And promise yourself that you'll never again use the completely outdated and fundamentally flawed HSV blend modes.
- Make three additional copies of the scene-referred layer and put one copy inside each layer group, as shown below:
Setting up the Lightness, Chroma, and Hue Layer groups
Initially each Layer group contains a single copy of the scene-referred layer (the "before" image), just as it was output by the raw processor, except the copy of the scene-referred image that's in the LCH Lightness group is desaturated to black and white using "Colors/Desaturate/Luminance".
The copies of the original scene-referred layer that are inside the Chroma, Lightness, and Hue Layer groups should be set to Normal blend mode.
The three copies of the scene-referred image form the bottom of the Hue, Lightness, and Chroma Layer stacks and are never actually edited, other than desaturating to Luminance the copy in the Lightness Layer group.
Also the original scene-referred image at the bottom of the layer stack is never edited. If you like you can lock the pixels in the original layer and in all three copies of the original layer.
The resulting image still looks just like the "before" image, because we haven't done any editing yet. The first actual editing step will be to make a layer for controlling Chroma:
Edit for Chroma
Working in the Chroma Layer group
The Chroma Layer group should be set to the LCH Chroma blend mode. The layers inside the LCH Chroma Layer group should be set to the Normal blend mode.
The original scene-referred image needs a chroma boost. So working in the Chroma Layer group:
- Make a copy of the scene-referred layer ("Make New from Visible", or just duplicate the scene-referred layer) and make sure the layer blend mode is set to Normal. Change the layer name to "Visible + Channel mixer to add Chroma".
- Select the "Visible + Channel mixer to add Chroma" layer. Then do "Colors/Components/Channel Mixer" and change the channel settings as follows:
- Red channel: 2.000 / -0.500 / -0.500
- Green channel: -0.500 / 2.000 / -0.500
- Blue channel: -0.500 / -0.500 / 2.000
- Make and add a suitable Layer mask to the "Visible + Channel mixer to add Chroma" layer.
I already knew that I wanted to make the blue sky not quite as colorful as the trees and ground. So my initial mask for the "Visible + Channel mixer to add Chroma" Layer was made as follows (it sounds complicated, but it's easy to do in practice, and I hope to write some code to eliminate the need to drag the layer out as a new image to fix the TRC):
- Make a copy of the layer "Visible + Channel mixer to add Chroma".
- Extract the B channel using "Colors/Component Extract" and select the LAB "B" channel. Change the layer name to "LAB B channel".
- The resulting extracted layer will have the wrong tonality because the "Component Extract" procedure doesn't take into account the TRC of the layer stack. So drag the B channel layer out as a new layer and assign to it a V4 RGB working space profile from my profile pack that has the "LAB L" companding curve. These profiles all have file names ending in "-labl.icc".
- Drag the resulting layer back to the original layer stack. Go ahead and delete the originally extracted layer.
- Make a layer mask using "Grayscale copy of layer" and load this mask as a selection.
- Add the selection as a layer mask to the original "Visible + Channel mixer to add Chroma" layer, and then delete the modified extracted layer.
I gave some minor tweaks to the LAB B channel mask was as I continue editing. The final mask is included in the downloadable tar.gz file for following along in this tutorial.
The "Visible + Channel mixer to add Chroma" layer will get a whole lot more colorful. It will hurt your eyes. It might burn a hole in your screen. But don't worry, we'll tame all that chroma with a layer mask.
And that's it. The Chroma edits have all been made.
Well, for images other than the one used in this tutorial nobody will hand you a pre-made chroma mask. So in reality, as you work in the Lightness Layer group you'll be tweaking the masked layer in the Chroma Layer group, maybe even quite a lot. This is because although LCH Chroma is independent of Lightness, the appearance of Colorfulness is not. And the usual goal when editing a scene-referred image is to increase Colorfulness, not Chroma.
Tweaking the mask for the "Add chroma" layer is a pretty important part of editing Lightness, Chroma, and Hue in separate Layer groups. If you don't have a clear idea of which image colors you might want to make more colorful in your final image, start with a mask filled with 50% LAB L gray, which is the same as 18% gray in a linear gamma RGB color space, or R=G=B=47 using GIMP's RGB color sliders (47 divided by 255 is 0.18).
Remember these values for future reference because it's pretty handy to know that 50% LAB gray is equal to 18% RGB gray (more precisely, 18.4187% gray). Making a 50% LAB gray mask is easy — In the "Change Foreground Color dialog, set the "L" (Lightness) slider to 50 and the "C" (Chroma) slider to 0. It doesn't matter what the "H" (Hue) slider is set to. The resulting RGB numbers will be R=G=B=47.
Edit for Lightness
The Lightness Layer group should be set to the LCH Lightness blend mode.
For this tutorial, the layers inside the LCH Lightness Layer group should be set to the Normal blend mode. But you can also use other blend modes that modify tonality, right inside the LCH Lightness Layer group, for example soft light blend for doing high pass sharpening. (If you are new to high bit depth GIMP, the high pass filter is found under "Filters/Enhance".)
Working in the Lightness Layer group
The following steps use Curves. For radiometrically correct editing, in my patched GIMP Curves (and also Levels, Invert, Value Invert, Brightness/Contrast, and Auto Stretch Contrast) must be done in a linear gamma RGB working space. The same is true for the Normal blend mode that's used for the layers inside the layer groups.
The Chroma Layer group only required two layers, and one of them was just the scene-referred layer that wasn't (and shouldn't be) edited. The Lightness Layer group requires five layers, again including the unedited scene-referred layer at the bottom of the layer stack. All five layers in the Lightness Layer group are set to Normal blend:
- Exactly as with the Chroma Layer group, Layer 1 is a copy of the original scene-referred image. The only difference is that I desaturated the layer to Luminance ("Colors/Desaturate/Luminance"), for reasons explained below.
For those of you who just can't get enough of color science, RGB Luminance has the exact same tonality as LAB/LCH Lightness, which has the exact same tonality as the "Y" component of XYZ — the only difference is the color space used to express that tonality.
- Layer 2,"Visible + Curves to lighten, targetting the sky tonality", uses Curves to establish the overall tonality of the sky.
This layer starts as a copy of the scene-referred layer. So you can make this layer by using "Make New from Visible" and then desaturating the layer to Luminance. Or else just duplicate the already desaturated scene-referred layer. Then relabel the resulting layer and do "Colors/Curves", using the "sky.curves" preset from the downloadable tar.gz files.
My goal for Layer 2 was to get the sky Lightness close to just about right, without worrying about the rest of the image. The scene-referred image was deliberately underexposed "in camera" to avoid blowing out the highlights in the trees, but it was actually a fairly high dynamic range scene. So after establishing the sky Lightness, the trees and ground were still too dark to suit my previsualization of the final image (though sometimes I think stopping right here might not be such a bad idea).
- Layer 3, "Visible + Curves to further lighten trees and ground", establishes the tonality of the trees and ground. It was made using "Make New from Visible" and then desaturating the resulting layer to Luminance. Then a Curves adjustment was applied to raise the Lightness of the trees and ground, using the "ground.curves" preset form the downloadable tar.gz files. Layer 3 was masked to not affect the already-established sky Lightness.
- Layer 4, "Visible + USM 24.0/0.1" uses high radius/low amount Unsharp Mask to enhance local contrast, which gives the colorful Autumn leaves a lot more definition. This layer was made using "Make New from Visible" and then desaturating the resulting layer to Luminance. Then I used the following Unsharp Mask ("Filters/Enhance/Unsharp Mask") settings: 24 for the Standard Deviation and 0.100 for the Scale (in case you are wondering, "Scale" refers to the strength of the effect).
For the reduced size image that you downloaded if you are following along with the tutorial, try USM settings of around 8/0.100.
- Layer 5, "Visible + Curves to increase sky gradient" increases image contrast. It was made using "Make New from Visible" and then desaturating the layer to Luminance (I'm sure you get the drill by now). I used Curves, pulling the toe of the curve down to increase the gradient as the sky darkens from the lower left to the upper right sides of the image, using the preset "increase-contrast.curves" from the downloadable tar.gz files. Layer 5 was masked to mostly affect the sky, but I let a little bit of the added contrast show through to portions of the trees and ground.
My apologies, but I'm almost certain that the three curves in the downloadable tar.gz file for following along in this tutorial are close to, but not exactly the Curve presets that I actually used.
And now all the Lightness edits have all been made.
It will be much easier to make and modify the Lightness edits when the happy day arrives that GIMP provides Adjustments Layers. But one step at a time, GIMP is already amazing.
Why I desaturated all the layers in the Lightness Layer group
The only two editing operations I used in the Lightness Layer group were Unsharp Mask and Curves. At floating point precision, Unsharp Mask, Channel Mixer and "Colors/Desaturate/Luminance" do not clip out of gamut RGB channel values. Also the Normal, Lightness, Chroma, and Hue blend modes and the RGB Luminance blend mode (see Section F below) do not clip out of gamut channel values. (To reiterate, if you are operating at integer precision instead of floating point, all editing operations clip.)
However, even in high bit depth GIMP and even at floating point precision, Curves clips out of gamut channel values (for Curves to *not* clip we'd need user-programmable parametric curves, which would be nice but also would limit the Curve shapes you could make). So I was careful to bend the Curves at the top to avoid blowing out highlights. And I also took the precaution of desaturating to Luminance each "Make New from Visible" layer ("Colors/Desaturate/Luminance") in the Lightness Layer group before applying that Layer's editing operation.
Desaturating each "Make New from Visible" layer in the Lightness layer group as a way to mitigate clipping might seem like an odd move. But consider that to make color, the RGB channel values are not equal. The more colorful a color is, the farther apart the RGB channel values must be. The combined Chroma and Lightness Layer groups added a fairly significant amount of colorfulness to the Early autumn colors image, which in fact did drive some of the more colorful regions of the image beyond the limits of the sRGB color gamut. Desaturating each layer of the Lightness Layer group before performing the next edit significantly reduces the potential for clipping colors along the way.
Before the final image can be exported to disk for printing or for display on the web, the out of gamut colors must be dealt with one way or another. But allowing those colors to "clip along the way" produces uncontrolled Lightness, Hue and Chroma shifts. In high bit depth GIMP, keeping the colors unclipped until the output/soft proofing stage of your workflow allows you, as the artist and photographer, to choose when and how to deal with out of gamut colors.
Edit for Hue
The Hue Layer group should be set to the LCH Hue blend mode. The layers inside the LCH Hue Layer group should be set to the Normal blend mode.
So far we have zero hue shifts from the original scene-referred image
If you separately edit for Chroma and Lightness as outlined above, there will be absolutely no hue shifts in the resulting image, compared to the original image at the bottom of the separate layer stacks, apart from hue shifts caused by accidentally clipping out of gamut colors.
In this tutorial the only editing operation we've used that clips is Curves, and we've taken great pains to eliminate clipping out of gamut colors while performing the Curves adjustments.
In Figure 7 below, the Sample Points show the Hue, Chroma, and Lightness for four important colors in the image:
- The blue sky.
- A shady spot in the green grass.
- A deep red leaf in the foreground.
- A yellow leaf in the central tree.
Compared to the scene-referred image on the left, in the finished image on the right the Chroma and Lightness have been raised for all four colors, without causing hue shifts:
Editing for LCH Lightness and Chroma in separate Layer groups, (and for CCE using a linear gamma RGB working space for all tonality adjustments and layer blending), plus taking advantage of GIMP's unclamped editing operations, has allowed us to modify Lightness and Chroma without also modifying Hue.
Unlike HSV "Hue", LCH Hue is color-space-independent. However, the HSV color picker does show hue shifts. These hue shifts are spurious and will vary depending on the image color space. Digital artists especially might want to note that when using an HSV (or HSL or HSI) color picker to choose colors, it is not possible to use the "Hue" slider to choose light and dark colors that have "perceptually the same" LCH Hue.
Eventually any out of gamut colors that are produced during editing will need to be brought into gamut before you can export the image to disk for printing or for display on the web. There are in fact out of gamut colors in the image, predominantly in the lighter portions of the sky and where the sun is shining through the autumn leaves. But it's nice to know that you can get this far in the editing process without all the unintentional hue and chroma shifts that are part and parcel of editing integer precision data using perceptually uniform RGB.
Reasons for modifying hues
On the one hand, if you are color-correcting an image that was previously mangled by someone else's editing, or by the camera itself when shooting jpegs, or by a raw processor that insists on "prettifying" your image for you, then control over hues is a critically important skill.
On the other hand, making hue adjustments is pretty much purely an artistic decision when you:
- Shoot raw and use a properly made camera input profile that doesn't deliberately mangle Hue and Chroma (the old Adobe matrix profiles produced oddly desaturated colors, and the new DCP profiles are designed to emulate various camera picture styles, which means bending Hue and Chroma in service of the camera manufacturers' idea of "pretty", which might or might not cohere with your own artistic intentions).
- Start with scene-referred output from a raw processor that didn't mangle your RGB values.
- Edit separately for Lightness and Chroma, using floating point precision and taking care not to clip interim RGB values.
Either way — color correction or artistic intent — I think you'll really like the fact that GIMP's LCH blend modes allow you to put your edits for hue in a separate LCH Hue Layer group, and edit for Hue without also affecting Chroma and Lightness:
Using the Hue-Chroma tool to modify LCH Hues without modifying Lightness or Chroma
In my opinion the Early autumn colors image doesn't require any hue alterations even for artistic purposes. But Figure 7 shows the results of two different hue modifications. Below on the left, I moved just the sky hues clockwise by five degrees, clockwise towards green (in nature "blue sky" hues range from purple-blue to green-blue). Below on the right, I left the sky alone and moved just the tree and ground hues clockwise by five degrees (as autumn progresses, autumn colors get warmer):
To move the hues around I used the Hue-Chroma tool, which produces color-space-independent editing results (and which in CCE absolutely must only be used when editing in a linear gamma color space).
Figure 8 below shows you how to use LCH Hue layer group to move the sky hues five degrees clockwise towards green:
For the rest of this tutorial, the Hue Layer group plays no further role and so was removed from the Layer stack.
Introducing the very awesome Luminance blend mode
You might have noticed that the layer that I used to increase Chroma in the scene-referred image was very saturated, by any definition of the word saturated. It had to be, because the Lightness Layer group literally only increases Lightness, leaving Chroma and Hue untouched.
GIMP has another new blend mode — the RGB Luminance blend mode — that also allows you to (partially) separate editing for color from editing for tonality.
Unlike the LCH Lightness blend mode, the RGB Luminance blend mode simulaneously raises Chroma along with Lightness. In other words, as the image is made brighter (for example using Curves or Levels), the RGB Luminance blend mode simultaneously raises Colorfulness.
Sometimes whether you use the RGB Luminance or LCH Lightness blend mode will make no difference whatsoever. And sometimes one or the other blend mode will work better for the particular editing task at hand. For example:
- If you convert an image to black and white, and make a lot of large tonality edits, and then blend the edited black and white image over the original unedited color image, you'll probably prefer to use the RGB Luminance blend mode. Using the LCH Lightness blend mode will absolutely require that you also modify Chroma, preferably in a separate layer group as shown in this tutorial.
- If you want to eliminate the chroma-shifting side-effects of sharpening a layer, use the Lightness blend mode.
I will leave it up to you to experiment to see what works best in your own digital darkroom. In my own digital darkroom I use both Lightness and Luminance blend modes, and I can't imagine going back to editing without both of these layer blend modes. But my task here is simply to demonstrate the difference between the two layer blend modes.
Figure 10 below shows the result of making the LCH Chroma blend group invisible and just applying the tonality edits in the LCH Lightness blend group:
So, you might ask, if the RGB Luminance blend mode for the tonality edits makes the image more colorful without having to bother with the LCH Chroma blend group, why not use the RGB Luminance blend for the tonality group and skip the LCH Chroma blend group altogether?
The answer is it depends on both the image and your editing goals for the image. For this particular image, I still would have added more Chroma to the image than was supplied by setting the tonality layer group to the RGB Luminance blend mode, so either way I would need the Chroma group:
Here is a great big Thank you! to the person who posted the bug report that provided code that made it possible to make a patch for adding Luminance to GIMP's blend modes.
Out of gamut colors: Why they are important and how to deal with them
If you want to take full advantage of everything high bit depth GIMP has to offer for image editing, you need to learn about out of gamut colors and how to deal with them.
To clip (use integer precision) or not to clip (use floating point precision)
As previously noted, out of gamut colors have at least one RGB channel value that is either less than 0.0f or greater than 1.0f. As I edited the Early autumn colors image, I use the Color Picker along with the Sample Points and Pointer dialogs to monitor for out of gamut colors. As you can see by the screenshot to the right, all four Sample Points are placed on colors that are out of gamut.
So the next question is where did these out of gamut colors come from? The original dark, flat, scene-referred image didn't have any out of gamut colors.
The answer, again as already noted, is that if you are editing at floating point precision using high bit depth GIMP, then many editing operations don't clip the out of gamut colors that are produced along the way. I've already listed a few such algorithms. Another such operation worth noting is that converting from larger to smaller RGB working spaces at floating point precision doesn't clip out of gamut colors.
On the one hand, out of gamut colors are very useful because they allow you to recover and work with color data that would otherwise be lost to clipping. On the other hand, out of gamut colors can produce a whole lot of headaches while editing.
Fortuately with high bit depth GIMP you have a choice: you can edit at floating point and take advantage of the out of gamut colors. Or you can editing at integer precision, in which case the out of gamut colors are automatically clipped.
Automatic clipping of out of gamut RGB channel values that would otherwise be generated by various editing operations produces two distinct editing problems:
- Irretrievable loss of detail that could otherwise be recovered by bringing the out of gamut colors back into gamut:
Sample Point 4 has a channel value that's greater than 1.0f in the blue channel, which naturally is the dominant channel for blue colors. Some of the yellows also have green and/or red channel values greater than 1.0 (green and red are the dominant channels for yellow), and if those areas had been clipped by the Channel Mixer operation, the affected areas would have had visible areas of lost details.
- Hue shifts:
Sample Points 1, 2, and 3 have negative channel values, but obviously not in the dominant color channel(s). Clipping a negative channel value is sometimes OK, and sometimes produces a visually obvious problem:
If the Red channel in Sample Point 1 had been clipped by the Channel Mixer operation, that would have pushed the blue sky color towards purple. This is because clipping a negative Red channel value to 0 is mathematically exactly the same as adding red to blue, which explains why adding saturation using Channel Mixer at integer precision (which clips out of gamut RGB values) can instantly turn blue skies to purple.
Clipping negative values in the Blue channel is like adding blue to a color. Adding blue to yellow or orange foliage usually passes without notice — the resulting color is less saturated but if the green and red channels are more or less equal, there's not much hue shift.
I suspect that most people are probably more sensitive regarding overly purple (or green) skies, than they are to shifts in the saturation and hues of fall foliage.
Being able to work with the out of gamut channel values is very useful because you have a chance to make deliberate changes at any point in the worflow, right up to the point where you export the images to disk for printing or display on the web.
But you do need to monitor and eventually deal with out of gamut RGB channel values. As soon as you output the image in a file format that doesn't support floating point RGB values (eg jpegs, pngs, and integer precision tiffs), any out of gamut channel values in the final image are immediately clipped.
Editing at floating point requires soft proofing before exporting the final image to disk
So when you've finished editing your image, what can you do to bring any remaining out of gamut colors into gamut with respect to your chosen output color space? This is where standard soft proofing techniques come into play:
- You can decrease Chroma and/or Lightness, either locally or globally.
It seems to me that digital photographers (including me) tend to make images too bright and too colorful. Proofing each image you work on to a wide gamut printer profile is good discipline, even if you have no intention of actually having a paper print made.
GIMP uses LCMS for ICC profile color space conversions, and as of LCMS V2.7 there are a couple of bugs in the LCMS algorithm for soft proofing:
- The gamut checks don't give accurate results for linear gamma images, so for accurate soft proofing you need to make a flattened copy of the final image and convert it to to a color space with a perceptually uniform TRC.
- The soft proofing algorithm doesn't seem to account for out of gamut RGB values. So to have a more realistic idea of what the output image will look like, duplicate the flattened copy and apply a "NULL" Curves correction (that is, select the duplicate layer, open the Curves dialog and then click OK, without actually moving any points on the Curve — don't ever do this accidentally, as it will immediately clip any out of gamut RGB values!).
- You can deliberately change the Hues of out of gamut colors, which sometimes help to move them inside (or closer to) the color gamut of your chosen output color space.
- Often simply letting some or all of the remaining out of gamut colors in the final image clip is the easiest and most aesthetically pleasing thing you can do.
- If the output color space is a printer profile, if relative colorimetric intent clips too many colors, you can try perceptual intent. These days the wider gamut printers have pretty large color gamuts. But the same is not true of printing processes for mass reproduction.
- For images posted to the web, if your audience is composed strictly of people who are likely to use properly color-managed browsers and wide gamut monitors, you can output to a larger color space such as AdobeRGB1998. But sRGB is still the safest bet for the web.
Oh, and in case you are wondering, I did my best to avoid out of gamut colors in the final Early autumn colors by using the Chroma mask to bring out of gamut colors back into gamut, focussing mostly on the colors with negative channel values. But in the final sRGB image for display on the web, I allowed the brighter blues in the sky to clip to 1.0 in the blue channel, and also allowed some of the orange leaves to clip to 1.0 in the yellow channel. So upon export to disk for display on the web, the output hues for these colors did shift. In particular, the blue in the lower right corner of the sky shifted from 254 degrees before clipping, to 242 degrees after clipping, and the Chroma dropped from 27% to 22%.