Gamut fix is a color transform lut to compress out-of-gamut colors into a smaller colorspace.
Editing/grading color images in a large gamut colorspace produces better results, but can cause very bright or saturated colors to become out-of-gamut, or outside the range of color that can be produced on a typical display.
When converting to a smaller colorspace like sRGB, values that are too bright get clipped to 1.0 and colors that are too saturated will have negative values that are clipped to zero. In areas of an image where one or more channels are clipped, the color becomes distorted and can lack detail, appear inaccurate or as a harsh edge in what should be a smooth gradient.
Image processed with Adobe Standard and the Gamut Fix lut.
color, red, green, and blue channels.
Anyone color-grading/editing photos or video with bright colors intended to be viewed on a screen.
The gamut compression algorithm is based on the one shown by Jed Smith and others on GitHub with a few additional steps.
- Luminance correction after compression.
- The distance limit is calculated based on the edge of the larger color space.
Brightness is compressed using the same curve function as saturation. The amount of compression varies depending on the color. For a given color, the distance limit is calculated from the maximum possible brightness of that color in the large space relative to the small one. For example: sRGB red can be 63% brighter in ACEScg, so the compression limit is 1.63. The function is applied as a per channel curve.
The brightness limit can use a different color space than saturation. I used ACEScg instead of proPhoto because it is a better fit for sRGB and has a less extreme gamut.
If you use the Adobe Standard or Adobe Color profiles, you can use the “gamut fix” xmp profile files. The adobe color version has less brightness compression. Adobe Standard has an adjustable amount from 0% to 100%.
For other camera profiles, you can use the Create Profile menu in Camera Raw.
- Open an image with default settings (everything at 0, white balance: 'As Shot')
- Select your camera profile
- Option/Alt click the new preset button
- Change the profile name
- Load
ProPhoto to sRGB.cube
as a Color Lookup Table - Set Space to
ProPhoto RGB
- Set Amount Max to 100
- The lut must be applied in the correct colorspace.
- The input/output colorspace is the first one in the file name and is in the cube file header.
- It should be applied at the end of the editing process after all other filters and adjustments.
- I made separate luts for saturation and brightness. The brightness lut can use an adjustable mix amount depending on how much is needed.
Some camera profiles, such as camera matching profiles, already have gamut mapping built in and do not need the extra lut.
This lut is not a replacement for pre grade gamut compression. Some subjects such as stage lighting or vividly colored flowers will need gamut compression applied before color grading. For RAW editing, this needs to be part of the camera profile.
If there is a different set of color spaces that you would find useful, let me know and I may consider adding an other lut version.