rebooting color balance

Color balance is a pivotal point of the color grading process, which for me is a very important part of visual language and expressivity, in fact much more important than sharpness or optical cleanliness.

The current darktable color balance is still sub-optimal to me, plus it is a remenant of the Lab pipeline, doing masking and blending in Lab while the guts of the module works in RGB.

After the 2 sprints to deliver releases this year (3.2 in August and 3.4 right now), I needed to indulge myself with a color organ allowing me to get exactly the colors I have in my mind while unleashing the power of clean and up-to-date color science.

This week, I developed a new, revised, color balance. I let you with the details and samples, along with the code to test it, on Github :

This is R&D code, so I need a lot of field testing. Thanks in advance and merry Christmas.

PS: I understand this module will be too complicated for most, but there is no other way around. Color is difficult and it’s the only way to achieve the colors I like: soft halftones, beautiful pastels and vibrant primaries, even with inconsistent lights and tricky illuminants.

20 Likes

Hello @anon41087856

Thanks a lot for ALL your contributions these past years!

PS: I understand this module will be too complicated for most, but there is no other way around.

I have cursory read your post on github - pull requests yesterday and it is not so simple to understand indeed (I am a poor plant pathologist guy who only takes macro pictures of my plant disease samples at work…) :slight_smile:

This being said, I am indeed grateful you have been releasing such marvellous state-of-the-art features, for everyone, to enjoy!

At present, given my background on Windows, it looks to me like Darktable migth become a “competitor” of softwares such as Capture one, in particular, since Capture one is intended for “power users” and it is justly famous for its “color-grading” tools.

In the past days, I have done a little donation to you through PayPal and I could have not spend my money better :slight_smile: :slight_smile:

6 Likes

Wow, this is really a major thing, I’ve just recently started reading a color science book and by that I am starting to understand the current colour balance module, but this beast seems to really do everything! I guess I still have a lot to learn :slight_smile:

Also thanks for the book recommendation in your github, I think I know what I will read next!

2 Likes

Love the work done bringing these modules into the unbounded, linear rgb, scene referred workflow. This will be fun to play around with. Also like the accurate naming of things (‘chroma’ instead of ‘saturation’, where appropriate), and the addition of ‘tonal weight’.

I notice there is no ‘contrast’ or ‘fulcrum’ slider. Is that because those in the current color balance module are already optimal? Other reason?

Also, just a suggestion (I walk on eggshells), to avoid confusion with current color balance module, perhaps a different name? Color Toning? Something else? Just as new channel mixer is called color calibration instead of channel mixer rgb.

The contrast can be achieved through the tonal corrections or tone equalizer. The current color balance contrast was introduced before all that but has many flaws (non color-preserving and changes the white point that you are supposed to have fixed in filmic first).

I don’t know, but it is a color balance. I have found that trying to be clever with names does often the opposite of what is intended.

2 Likes

@anon41087856 maybe simply call it “color balance pro”, nowadays everything is “pro” and in this case it would even make sense imho.

Another a big thank you for all your work from me , really appreciate it!
I digitized thousands of old slides by shooting them with my digital camera. filmic rgb made my day and saved incredibly much time. I even decided to re-do hundreds of RAWs that I already had worked through with the old basecurve workflow - in comparably no time.

I get weird colors on highlights when boosting saturation, but you must disable filmic, as extreme luminance saturation does its job and desaturates them: Color Balance RGB saturation slider producing artifacts in highlights ¡ Issue #7689 ¡ darktable-org/darktable ¡ GitHub

https://github.com/darktable-org/darktable/pull/7909

6 Likes

@priort The Dimensions of Colour is what I have been looking for, so thank you for pointing that out. You said, “you have the ability to edit saturation, chroma, and purity…” I can’t seem to correlate that to the module layout.

image

Manipulating luminance and chroma are useful, but a slider for true saturation for each hue, I would think, should be there also. How would you take red at 100% saturation to 50%?

I don’t want to make trouble. When I went to college, there was a cartoon on a bulletin board, one fellow says to another, “Six months ago I didn’t know how to spell eginear, now I are one.” Two minutes ago, I didn’t know the correct definition for saturation.

I likely don’t have the best answer but you will only affect the highlights here so you aren’t going to take a red to 50% using these sliders. These sliders in the color balance module are to work on color grading and color cast. If you use the picker it will in fact select a color 180 degrees from what you have selected on the screen so as to “neutralize” it. You can can then tweak luma or chroma to dictate the strength of this modification and correct your color . If you add or subtract 180 degrees tothe hue then you will have the actual color you selected and you can use CB to enhance those colors in the highlights…works nicely for say enhancing a sky…

2 Likes

… and if you are lazy, darktable allows input like 19.1 + 180 or 243.7 - 180. You have to watch the sign, though, as it does not wrap around, so 15 - 180 = 0 and 200 + 180 = 360 (instead of 195 and 20, respectively).

I think you misunderstand that.

The first tab “master” manipulates luminance and chroma at constant hue. This helps making colors more or less colorful at constant hue, but doesn’t change anything else.

The “4-ways” setting allow to shift colors, more or less along a hue. So hue is not constant anymore. And the chroma, in this context, is only the setting allowing to define “how far along that hue” you want to go. Any hue shift with chroma == 0 is a no-op. That chroma is the chroma of the color deviation you want to create, aka the intensity of the shift.

2 Likes

Thank you for being so patient and your explanations. I’m slowly catching on. :smiley:

1 Like

To put some perspective on these terms:

1 Like

Hi @Underexposed ,

you asked me once if I will make a video with new color balance module. I don’t plan to, but I’ve had a look at the module and find what @anon41087856 has done very interesting. To demonstrate this, I took a linear grayscale as a starting point, so that you can see what the module does with the help of waveform histograms.

This is how the initial image looks like. In Waveform the grayscale is represented as a diagonal straight line from bottom left (shadows) to top right (highlights):

Since we need a colored image, I colored this grayscale image red in the first instance of the color balance module, so that we can see what happens when we move the sliders in the “master” tab of the module in the second instance of the module:

I won’t go into Hue Slider, because it rotates the colors, which doesn’t need any clarification.

It will be interesting to see what happens when we move the sliders in “linear chroma grading” and “perceptual saturation grading”. We now move the “global” slider to the right for both of them one after the other and compare the results:

linear chroma grading:

perceptual saturation grading:

As you can see, in “linear chroma grading” the red channel is progressively increased in comparison to the brightness axis and at the same time the blue and green channels are decreased proportionally along the brightness axis, so that the lightness remains unchanged and only color becomes more intense.

In contrast, with perceptual saturation grading, the red channel is increased uniformly over the entire lightness range and the corresponding blue and green channels are decreased parallel to the lightness gradient. In this case, color levels appear much more contrasty and darker in the direction of black (this can be seen especially well in the middle gray area). In other words, if you increase the saturation, the brightness contrast will also increase.

I will not go into detail about other sliders in both areas, because they simply influence the corresponding brightness areas.

With “purity” (later possibly called “brilliance”) you can additionally influence the contrasts. Here is an example of a nice logarithmic contrast:

If I want to increase the color intensity in highlights, I can use highlights slider either in “linear chroma grading” or in “perceptual saturation grading” depending on how the color intensity should look like:

linear chroma grading:

perceptual saturation grading:

Note how with “perceptual saturation grading” the color in the mid-grey area is influenced more strongly!

7 Likes

Additionnaly, purity/brilliance makes reflective colors (natural surfaces reflecting some light) behave more like emissive lights (as if we replaced the colored surface by a colored light bulb). So when you dial up the brilliance, you dial up the emissivity of the surface, which is kind of like dialing up the “equivalent light bulb” (kind of because it’s not on a physical scale, but the principle holds). That’s why purity/brilliance makes the color brighter and richer at the same time.

4 Likes

Thanks to both of you, @s7habo and @anon41087856: a powerful module and very helpful explanation.

I like this demonstration


Also this one esp as a demonstration of why the UI grey theme and color evaluation tools are helpful to keep things consistent

1 Like

The choice of black UIs for photo editing software is merely marketing : any picture opened in a black surround will pop out much more, so you get the idea that the soft makes your pics instantly better.

And then, when users complain about their darker-than-preview prints, you just have to pretend it’s because of a faulty printer color profile.

But these soft are “industry standard”. :man_shrugging:

1 Like

May I ask how this is achieved? @priort demonstration makes it look like a contextual deduction of what the actual illuminant AND it’s intensity is. But how can an illuminated white paper be discerned from white light in the distance that is not illuminating the scene? Does the algo assume a global (one illuminant for the whole pic) illumination or is there a locality introduced?