Color balance RGB, Hue change, Gamut... Queries

… and Playraw if you fancy

I was processing this recent pic and decided I’d try changing the colour of the flowers to match the brick wall, as an exercise. I used the color balance rgb module and changed the hue shift.


I noticed a few things I don’t understand, hopefully someone might be able to explain.

Firstly, I’m wondering why it’s so hard to control the gamut of the flowers. I have an exposure mask on them and have reduced exposure by nearly 2/3rds EV. In col.bal.rgb (same mask) I have global saturation fully left and global brilliance appreciably left. Filmic sat. is only 3%. Yet the flowers are fairly OOG, as below. I’m puzzled why the wall is ok but not the flowers; the flowers don’t look more vibrant/colourful than the wall to me.

Then I tried the color picker. The window frame, which looks quite bright to me, gives about 240 for the R channel (G,B lower). The flowers give up to 273. The brick up to only 236. Seems weird, perhaps one of those illusion things?

If the Hue slider is now moved to say -138 to make blue flowers, things seem to go a bit haywire. There are burnt out areas at (255,255,255) and large negative R values where blue, eg (-369,165,200). This seems odd.

Lastly it says in the manual that “The global color picker works in display RGB color space”. Doesn’t that mean if you change the display profile (right click of the softproof button) then you should get different numbers? But I don’t. Does the color picker show you pipe values just before Output Color Profile module, converted to display profile?

All this is with dt 3.6.0.

Here is the raw and my XMP -
03218.CR2 (60.3 MB)
03218-statue-flowers.xmp (53.6 KB)

Licensing: May not be reproduced outside of the Pixls.us platform

1 Like

Picker will show you the histogram colorspace…it does run through display first so really the only true way (unless this has been fixed to show gamut ) is to set your display profile and histogram profiles to be the same so for instance rec2020…your image will not look good on the screen but the gamut will now be accurate…part of the explanations can be found here…I am not sure how easy this will be to correct going forward until this processing order is modified.

Ain’t no conversion about gamut that doesn’t state the gamut of what space. “Gamut” is not an absolute thing, it’s relative to a particular color space.

The fact that a RAW image exceeds sRGB/Rec 709 gamut is a non-information. In darktable, we take great care of honoring Rec 2020 gamut because it’s fairly close to the whole visible locus, so anything out of Rec 2020 has good chances to not even be a visible color. That’s why we care.

But then, your pipeline can and will leak outside of your printer’s gamut and sRGB. That’s how it is. The question is : does the CMS do its job at remapping properly to output space ?

That gamut alert you show us is using a very particular space defined in a ICC profile chosen in the “softproof profile” option. Depending on the space selected there, what you show might or might not be concerning.

1 Like

I should have said, the softproof (and histogram) profile is sRGB web safe. The display profile is AdobeRGB. Working profile is default, linear rec2020 with gamut clipping off. I haven’t digested the github item above, tonight has been football!

I set preferences to use little CMS with a perceptual output profile. Is that what you’re referring to when you say “does the CMS do its job”? And who can answer your question? - I can’t!

So…

Nothing to be concerned about then. sRGB is going to be exceeded if you shoot raw, that’s business as usual.

If you don’t see suddent hue shifts in the middle of what should be smooth colorful gradients, then it does its job.

The general rule is to stop being concerned about the gamut as long as nothing visually weird happens in the screen. All the little scopes, alerts and clipping warnings help to diagnose problems when you see them happen, they are not excuses to make up issues on matters you half-understand when everything looks good otherwise.

…but I’d like to 3/4 understand, or more…
And it doesn’t all look good otherwise. I mentioned blue. With hue around -100 this is the result -


Why have the flowers gone so bright? They are now burnt out with the clipping indicator (next to raw indicator) set to Luminance confirming that. But the flowers are not burnt out at various other hues. Perhaps I don’t understand, but I would have thought changing hue would not much affect brightness/luminance.

I have to check what exactly happens, but there is no guaranty that same luminance and chroma at different hue are still in gamut.

See The sRGB book of color - Aurélien PIERRE Engineering

If you start at a redish-orange hue (sitting on that yellow hill) and swap hue to move left (to blue) at same chroma (parallel to x axis), you end on top of the blue valley, aka out of sRGB gamut. In that case it’s possible that filmic simply clips to white or near-white.

Color spaces don’t care about visual properties of color (chroma, hue, luminance). That’s only for you and possibly the GUI controls. The max chroma available in-gamut is different depending on hue, so shifting hues at same chroma and luminance is not necessarily gamut-safe.

Would it make sense to have some type of hue “rotation” slider that normalizes chroma based on that graph? It could be useful in situations like these.

Maybe I’ll even take a stab at it, I’ve been meaning to find a reason to gain familiarity with the codebase.

The image reminds me of the aftermath of an artillery game I used to play in computer class. :stuck_out_tongue:

1 Like

Thanks for the explanation. So I’ve made one change, put Global Chroma nearly fully left, and now I have Hydrangeas (sort of) -

@nish , Yes, I think so. Or color balance rgb could perhaps have an option to automatically adjust the chroma as you change hue?

It’s a lot more complicated than that, because that graph depends on the lightness too : checkout the ones around 20-40% lightness, the valleys and peaks are not at the place anymore.

Also these graphs are produced in display-referred (bounded to 100% display luminance) while color balance works in scene-referred.

Color balance RGB works in Rec2020 and already has chroma clipping in Rec2020, which is irrelevant for the current problem. The problem here is with the output RGB space (sRGB), which is no concern of the pipeline, since the pipeline is a master. The last step of water-tightening for darktable will be a proper internal gamut mapping at output color space conversion. Hopefully for Christmas…

4 Likes

Ah I see what you mean, so it makes sense for gamut mapping to handle this. Thanks for the explanation!