ACES2 CAM DRT soft clipping

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.

Inverse?

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?

Test results

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.

hard clip:


soft clip:

hard clip:


soft clip:

Images

First image is the hard clipped, second image is the soft clipped. All images are gamma-up by 4.




















2 Likes

I’m so glad this issue has so much attention!
Fixing this can really affect the speed of color grading by being way more forgiving to the shadows adjustments. When I set flare level of a shot by offsetting linearized image, colorful objects are often clipped in the shadows way before the neutral blacks reach 0. And it often requires additional time for fixing it to be sure there won’t be any artifacts visible on crappy displays. And it’s not what a colorist want to explain to a client, why they need additional time to gamma up (after DRT) the whole project and to fix this. So sometimes I just hope, director and producer won’t be watching it on a really crappy monitor with lifted shadows or on VA screen display that can expose these artifacts.

1 Like

I’m not allowed to post the actual image, so here is just the vectorscope. It’s a strongly clipped in the shadows red dress through v34 rec709. Just wanted to share that I found this skew of red towards yellow in path-to-black very “filmic”. At least it reminds me all those movies mastered by Deluxe film lab.
I guess it’s ok to have hue skews in the shadows? I mean, there is not so much difference in dynamic range in shadows between SDR and HDR compared to highlights. So maybe these skews can stay?

Screenshot 2023-04-07 154151

Is there a nuke script of just this “latest” version of the xyz to hellwig ?