Best practice for "unexpected white balance coefficients" in darktable

I suggest giving this section of the manual a very good and detailed read. I’m linking the 4.2 draft version of the manual.

https://docs.darktable.org/usermanual/4.2/en/overview/workflow/process/

Then watch these two videos:

1 Like

One thing to remember …getting the jpg colors and getting the right colors are not the same. And white balance in theory should be used more for the right colors… Using a color card you can do some things to set up your camera for the right colors and then can edit from there… if instead you are trying to match the jpg there are ways. Darktable chart is now working or you can try to manually match your jpg reference…legacy wb is perfectly safe and if it gives you good results no problem to use it… modern white balance performs a CAT using all the rgb data but does rely on those reference values which are off for some camera’s… If you don’t have weird lighting or are not needing to mask for a dual illuminant or wb maybe just stick to legacy …and resort to modern for more complex lighting situations… For sure if you have a color chart run it through color calibration color checker adjustment to see how far off it is and how much better you can make it…

Yes, it is. What I meant was that you don’t need to do the business with the 6500K white… frame… whatever. That’s effectively for setting up the internal translation from the file to the settings that you set in color calibration. But when things are working how they should, that’s already done in the background, and all you need to do is use the controls in the CC module to set a neutral white balance, so that things that are white or gray look white or grey as well.
Having said all that, in my opinion with some photos like the one above, there isn’t necessarily a ‘correct’ white balance and some theory may go out the window. Just my view, I hasten to add!

At what point are you assessing color…are filmic or sigmoid active or other modules…these can change the colors quite a bit so to initially understand the colors you are getting from your input profile and display profile you need to do so before those are in play IMO…

rename it cr3 and it will likely open…

1 Like

DT has a lot of color science…just looking at your jpg for sure the blue is likely way out of gamut… DT will fight you esp if you use v6 ie the most recent version of filmic… If you have a color chart you can do jpg / raw pairs and create a clut tone curve that will help to match them but chasing jpg colors from raw files as you might see by searching the forum is generally not worth the time and effort. You will rarely find a consistent formula… if you like the jpg… just use it …when its crap edit the raw file…

A simple formula for punchy is get your exposure right, apply filmic, set white and black levels… 150% local contrast and one of two 15% global chroma and 30% global saturation or 20 and 40 if you need more…

Using that general approach and filmic v5 which is my preferred version… I came to this… Not really trying for an exact match of the jpg just trying to capture something in the ball park… using legacy wb which I alway do for some image that I don’t own the camera and have not confirmed the D65 coefficients for…

You could easily tweak the brightness of the blues or the hue or saturation in 2 or 3 different tools

I’m assessing color after the whole pipeline, I think. So I have white balance, color calibration, color balance rgb, and filmic rgb. I’m playing with several photos to try to get punchier colors. What I’m doing right now is setting white balance according to my photo of a 6500K light panel, which means R/G/B coefficients of 2.56, 1, and 1.557. Then in color calibration CAT, I manually set the white balance a second time and ignore the warning (now that I know that is okay). Then in filmic rgb I increase the black relative exposure to get slightly blacker blacks, which makes the colors pop more. Maybe fiddle with contrast. Then I use the “vibrant colors” preset in color balance rgb. Finally, I tweak the individual matrix components in the R/G/B/colorfulness/brightness panels of color calibration. Sometimes if there are blown highlights I disable “preserve chrominance” in filmic rgb options to avoid getting magenta clouds and such.

I didn’t know about sigmoid until @123sg told me about it, so that’s definitely something I will consider.

I haven’t been using local contrast, so this is something I will try. The vibrant preset I’m using doesn’t touch global chroma, so maybe I should do that. It does increase global saturation, but then decreases it in the highlights–maybe that’s helpful for making things shiny. I’ve read color dimensions in the manual but still have a hard time understanding how you can adjust chroma and saturation separately, when they are overlapping concepts. Isn’t saturation just chroma scaled by the brightness?

Anyway, I’ve got a lot to digest from what you said and the two videos suggested by @g-man, thank you.

Wasn’t Sony the files with a different white balance than dt thinks it has?

The manual describes it as “unexpected white balance coefficients” that don’t work with the standard color matrix in input color profile. My understanding is that you can work around the problem by (ab)using the white balance module, and I guess ignoring the warning you get when also setting white balance in color calibration.

Well these would be what DT would use

image

So a little more red but a fair bit less blue… If things have been set up and you get consistent results then good… But these D65 numbers are not something you should need to play with a lot either the DT ones or your derived ones should give you the correct colors… I mentioned filmic as the color preservation mode can dramatically impact color and this should be a known change from setting up your color… I am also not talking about grading but getting correct colors from which point you could do your grading so it one thing to consider. Really you can go around in circles if you dont calibrate your camera and display… Then you know you have accurate color from the scene and the changes you make to suit your edit or taste is artistic … Personally I find no benefit to moving away from the legacy unless you are trying to wb the shadows and another area of the photo…then you can mask more than one instance of color calibration and do a sort of dual white balance. Sticking to legacy should use the values strait from the camera and not have you needing a good set of D65 values for color calibration… you can still use the many other functions of color calibration module without using it for wb… One check for sure could be that you take a snap shot of as shot legacy wb… CC deactivated… THen set CC to as shot and wb module to camera reference… THey should be very very close if not identical and if not then for sure there is a bias in your D65 values…one which you may actually like or not but its another way to test things…

Edit… I just did that test ie the comparison of legacy vs modern with Dt coefficients and yours… I could see a difference with the DT values whereas the new ones you came up with seemed closer if not identical comparing them with snapshots…

Global chroma and/or saturation will certainly help, possibly along with increased contrast in filmic… or if using sigmoid instead of filmic, saturation will increase by itself when you up the contrast (in sigmoid). Different algorithm. (I know, I know… stop waffling about how good sigmoid is… :smile:)

I don’t know about white balance, but for at least several models the raw white point as read by dt is wrong (too high)

The white level reading from Sony file has been fixed for dt 4.2 AFAIK.

1 Like

My version…

20230106_0126.ARW.xmp (11.5 KB)

I suppose that the light sources that we have in this photo are led, the one that has given me the best result has been the V2 at 4700 K.

Captura de pantalla de 2023-01-16 20-12-04.png

1 Like

That edit looks really good. How do I read the white balance you selected in the color calibration / CAT? On one hand 4076K sounds like very warm white, but then you also have a violet LED? And what would I select in color calibration if I wanted to use my D65-corrected white balance as suggested by Aurélien Pierre?

This is a little off topic, but is there an easy way to import an xmp file? I had to duplicate the image, then copy your xmp file to the right directory and add _02.ARW.xmp to the end, then select scan for updated xmp files on startup in settings, then re-start darktable and select the image and have the xmp overwrite it, then unselect scan for xmp on startup. Prior to that I tried re-adding the image to the library but that didn’t work. I’m hoping there’s an easier way to share xmp files…

Thanks.

You just select the image in lighttable and click load sidecar file in the history stack section.


See screenshot. If you select append it will make the changes on top of anything you’ve done already, if you select overwrite it will start from a blank raw. The latter is best in this sort of case IMO.

I’m a bit lost with this - I’m sure someone else can help though!

I’ve just rewatched the first part of that video from AP - it was quite long time ago that I watched before… It confirmed what I thought - that is you don’t need to do anything special in color calibration to use the D65 wb preset.

I tried it just now to be sure.

You just set up that preset in the White balance module, using a shot of a 6500k light source, as he shows in the first 12 min or so of the video, and color calibration automatically picks up the different coefficients being fed to it by the WB module. It’s not actually “abusing” the WB module by the way, just making it more accurate.

It won’t make the pictures look much different (at all) if you leave color calibration set to “as shot” (to use the wb the camera set) but if you use the built in settings in color calibration, like the one @dqpcoxeas used above for LED lighting, doing this D65 “calibration” (for want of a better word) ensures that they work properly.

Edit. Forgot to say, the warning about wb applied twice is normal and can be switched off in the preferences.

Hope this helps.

Maybe I should do this too!
I’m very much in the school of if it looks good it’s good - probably to the despair of some dt devs. (if they knew my workflow).
So I’m learning as I go - helped by the fact that I’m quite familiar with dt now.

You use this all the time…if you are referring to your D65 adjustments from the screen shot. Then normally CC would be set to as shot… This should be a match for the wb that was used by your camera. From there you can do a neutral pick on the entire image or a particular spot or as @dqpcoxeas did you can experiment with some of the provided illuminants

When I compared the adjustments that Frisco made …it was a very close match for legacy wb so right or wrong and likely wrong the default DT D65 values were introducing a bias… He found that it should be less red and more blue… I think its not a bad check for anyone that can calibrate their screen… I think AP said that right…save me rewatching but I think he said of a calibrated screen??