Struggling to white balance an image (Darktable)

So it is neccessary to keep the channel totals the same, meaning if I adjust one I should counter adjust another?

Also, to your earlier point, the flower did not look green to my eye in reality.

Regarding channel mixer, if I increase green in the red channel (just as an example) do I expect to perceive the image becomes more red? Could I not just increase red in the red channel? I think this is my sticking point, I tweak a slider and I don’t know what I am expecting to happen. Channel mixer, for whatever daft reason, is a stumbling block for me.

I did not say that it is necessary in the current context of adjusting a selected area of more or less the same color.

As one might expect.

In dt, are you able to select an homogeneously-colored area, bring up a color mixer and simultaneously view an RGB histogram of the selected area?

You mentioned a degree of familiarity with matrices, of which our mixer is a 3x3.

Considering only the red channel, i.e. row, we know that R-out = (R-in x R-amount)+(G-in x G-amount)+(B-in x B-amount). Increasing any of those amounts will move the red histogram to the right. Too much and the red channel will clip at 255/255.

It takes a lot of twiddling (days, weeks, months even) before 3-channel color mixer adjustments become intuitive. A few minutes’ play after reading each post will not do it for you, sorry.

Thats not how it works…Think of it this way… if you have a two pixel values one where the green is lower and one where it is higher…Then adding Red in the green channel will make a change only to red but proportional to green of the pixel value …you can do the math for any pixel… In the sub groups you change only one channel red, green or blue but you do so in proportion to the value of the input channel that you choose times the multiplier… so if for example a pixel has a blue value of 0 or very low and you try to add red or green or blue to the pixel based on that input it wont’ do a thing…ie the RB slider the GB slider and the BB slider…

Its well explained here…

The Channel Mixer.pdf (68.9 KB)

Think of it this way…in the first group all you change is red…nothing else. In the group think of the r g b input channels as the current value of any pixel… If I have a pixel that is 128 128 128 and I move any of the sliders to double it from say 1 to two the result in this case will be the same… 256 128 128… Only red changes and in proportion to the input value of the pixel…That is what you are doing …and so the same in the next group you change only the green value of the pixel but in proportion to the value of the slider times the value of that r g or b pixel… following the same for blue…

Its funny on the initial rendering sometimes…so I opened the second image in DT… first off it didn’t look like it had too bad of a color cast … I went very simple and used standard wb as shot…no CC and did an auto exposure on the entire image and then the only adjustment was the tone eq to pull down the specular highlights… no filmic or sigmoid just simple

Just WB…region tags the flower color as gold with a slight dominance of red if just selecting the flower

Autoexposure

Tone Eq

Histogram with a little red shift maybe

image

I did two small channel mixer tweaks…Green input in red channel and Green and Red input in the blue which might not even need to have been done but just to make it a bit more yellow…

image

and

image

Leaves this

It could be tweaked lot of ways to shift the flower to the color that it should be and of course there might be exposure and or gamut issues as this is left in the screen shot that would perhaps mean some further tweaking and also some other modules.

1 Like

I find the RGB histogram of the selection invaluable in my example, especially for an almost monochromatic subject like his flower i.e. not the background and not the red petals.

With the brightness of the petals being a bit low, I first added Gx0.355 to G in R so as to move the red channel hist. to the right. Then I added Gx0.210 to G in G to move the green channel hist. to the right until it lined up with the red. Finally, I added Bx0.178 to B in B to lighten the yellow a bit. “Added” here means added to the default identity matrix coefficient e.g. G in G becomes 1+ .21 = 1.21.

Another play …

Here’s the first pic opened in RawDigger then in the GIMP:

A bit under-exposed, apparently, but outside the selected area the green cast is quite evident.

So I first doubled the default "1"s to brighten the selection without affecting the WB. Then I added 0.2 green-in-red so as to line up the peaks of the green and red histograms so as to turn the hue to pure yellow. It is of course possible to take the red histogram a little further to introduce a little orange if that’s how the flower looked.

Personally, I would be lost without an RGB histogram to check progress; and without which I suspect that @thehatterman would be wasting his time …

1 Like

A lot of manual tweaking for the white balance, to avoid the green tint cause by the plants around


DSC_0022.NEF.xmp (20.0 KB)

2 Likes

The rgb primaries module may be easier to use than color calibration’s channer mixer. It’s more limited, too.

With the original image, there are two complications:

  • mixed illumination: the background seems to be in direct sunlight, where the flower is in the shade;
  • no neutral patch in the interesting part of the image.

In such cases, I usually guesstimate the light temperature from standard values (~3000-4000k for sunlight, depending on time of day; 5000-7000 for shadow), then tweak “to taste”. In a case like this image, you cannot get one white balance value that is “correct” for the whole image, due to the presence of multiple illuminants (which the white balance corrects for). So I go for a compromise, heavily biased towards the main subject.

With the color calibration module, you can use several copies of the module with masking to set a different white balance for each part of the image. But that’s rather complicated to set up, and usually not really worth the trouble.

2 Likes

Yes.

Understood, makes me feel a little better. I will continue to play with it.

1 Like

This is a real eye opener for me, it is beginning to sink in. I read through the info in the link from priort, and re-read a few times the examples here. I think i am beginning to get this.

Had another go with my initial posted image, selected an area of the flower and paid more attention to the histogram. Sure enough, if I increase R in the G channel by .05, the green and red in the histogram lines up and the reddish tint goes away. Or, if I decrease G in the R channel by -.05, same thing. Off course one goes slightly brighter, one goes slightly darker.

Oh I am beginning to smile …

1 Like

Yes, I get that now. I can visibly see the effect my channel mixer tweaks have on the reddish tint, I can now apply my new found (basic) knowledge to work on the greenish tint.

Here is my effort with a minor channel mixer tweak. I have attached the xmp file aswell. Wouldn’t mind knowing if you think i am heading in the right direction (on the understanding that “correct” still remains subjective, I know).


DSC_0022.NEF.xmp (13.1 KB)

1 Like

Another little method I have used on many occasions esp with skin but it can work here too is the color zones…If you go to the chroma tab and then select the picker with the plus sign and draw a selection area on the green blurred background. Now hold the shift key and slightly adjust the box. This does a sort of auto desaturation which can often out of the gate remove the cast. You can also tweak the hue or darkness there but often you might just need to increase a bit the curve you get or reduce it a bit… In this case it will take out a lot of that yellow green and make the grass that deeper green that you get sometimes when you add blue… I am not sure of the math that is used but I have used it often on skin as well that is too orange or rosy and it seems to do a good job with little effort… You can mimic these adjustments in the newer color eq but I don’t think it has this auto function… I am not at my computer but I tried it last night esp on your second image and I found the results very pleasing… I can share it later… So selecting a region with the shift key will desaturate the selected area and with the ctrl key it does the opposite …

While you’re in learning mode, I feel there’s something else to consider adding to your perspective base. The lighting of the scene is where the need for white balance starts*, and that is where you need to pay particular attention to getting the colors right. Mostly, that’s just about getting a shot of the scene with a white/neutral patch of some sort in the light you care about. This doesn’t need to be in every “money” image, it just needs to be a separate capture in the same light.

Some scenes will vex you. My nemesis is a cabin in the mountains we occasionally visit; tungsten-warm lighting throughout thanks to the state park management, with large, beautiful windows to the outside splaying daylight in all its forms unto the interior scenes, as well as putting exterior components in the images. I can balance for the interior but the exterior goes to almost cobalt blue, balancing for the exterior is only somewhat better in the other direction. Sometimes, you just need to mask and treat each to it’s need…

You can also provide your own lighting. Movie crews don’t drag along literally tons of lighting equipment just because the union tells them to… In our cases, that mostly involves flash equipment, which I find to be of more use outside for fill lighting than anything. But indoors in the cabin, flash helps me to bring interior lighting to closer to the daylight, so I use that mostly for group portraits and such.

Paying attention to such makes post-processing white balancing less challenging…


*Well, it’s also influenced by the camera sensor, much the same way film for a particular type of light did, but we don’t mess with that much anymore since the whitebalance-for-lighting takes care of it too…

1 Like

A difficult one! First I tried RT Auto WB, where RGB Gray came close to what I imagined might be right …
Then fiddling with some WB sliders, Haze Removal and a local spot to remove the bluish tint in the dark area right of the flower.


DSC_0022_RT.jpg.out.pp3 (18.3 KB)

2 Likes

Guys, I am having a breakthrough. This discussion has been so helpful. I made another edit, using a mask with a second channel mixer. It’s not especially accurate, just a quick one to also remove the reddish tint from the background while also removing the greenish tint overall.

DSC_0022.NEF.xmp (12.1 KB)

It’s all about the light, I try to keep this in mind but in reality but I always forget to remember this!

5 Likes

I think that’s by far the best version yet

1 Like

Had another go at my second image aswell, just to remove what I see as a colour cast, I know it can be edited further. Think I am getting the hang of this.


DSC_0021.NEF.xmp (10.7 KB)

3 Likes

Sightly over-saturated in the yellow petal, IMHO. A lot of blues at zero = 100% saturated in HSV. Can happen if edited to taste in RT’s ProPhoto working space then exported as sRGB. Or exporting as ProPhoto JPEG where the browser will gamut-clip when converting for the average screen (sRGB).

1 Like

Went back to the scene of the crime on the way home from work tonight. That white blotch in the background is not the old greenhouse, it’s actually a dark brown garden fence and you can just see the top of a white conservatory over the top of it, in next doors garden.