All versions of the ACES2 CAM DRT has clipping inside the gamut that can lead to artifacting, hue skews and loss of tonality. This is especially evident in shadows. In my opinion, after gamut mapping and hard clamping, no clipping inside the gamut should happen. In other words, ideally none of the RGB channels would hit 0 until all channels hit 0 near display black, and none of the RGB channels would hit 1 until all channels hit 1 near display white. This doesn’t happen at the moment. Channels can clip to 0 or 1 at various locations.
I tried to improve this earlier by adding the compression range in the gamut mapper so that darker colors would be compressed more than brighter colors, but it doesn’t solve the problem. Something better needs to be developed. So, I decided to try soft clipping.
Soft clipping after gamut mapping - test
The idea is to gamut compress the gamut mapped, display linear values so that channels are above 0 and below 1, except at display black and display white. Hard clamp to 0-1 range can be done before this compression, or after it - both seem to work, though the effect is slightly different.
In my test I decided to use the ACES gamut compressor algorithm because it’s simple and has also hue-angle control, if needed (though I didn’t use it). I’m not sure if this is the best technique to use, but it seems to do the job and was fine for this test. Probably other similar techniques would work too.
In my prototype DRT repo there is
CAM_DRT_v032_softclip available for testing. It is otherwise identical to v032 but when the
Clamp checkbox is enabled it will perform the soft clipping.
I’d like to think of this as part of the clamp and in the inverse direction the question would become whether or not to apply the clamp. But should it/can it be inverted?
Display linear cube - forward direction
Following images show the effect of the soft clipping near the edges of the display linear cube. First image is the hard clipped, second one is the soft clipped. The input image is the Dominant Wavelength ramp.
First image is the hard clipped, second image is the soft clipped. All images are gamma-up by 4.