Best practice for "unexpected white balance coefficients" in darktable

‘within reason’, if I change the white balance to something else, and then reset CC to ‘as shot’, I get the same output.
That’s basically how I have been using the CC method (if I have been using it). By first correcting the white balance, or setting it ‘somewhat correct’ and then using CC and selecting a spot.

Aurelien once said - in his special way - shit in is shit out, regarding CC.

Anyway, from your response I read that the ‘invalid’ meaning is indeed nothing to be worried about (and I read often that people see that, and then start thinking about ‘oh I need the correct multipliers’).

But the correct daylight multipliers can still help in getting more accurate results, apparently.

( Still won’t help in case where the camera matrix completely mangles the colours before CC gets a chance to fix them, which is my issue with the modern approach ).

‘invalid’ (in color calibration) has nothing to do with the multipliers (a setting of white balance). It means that color calibration found that the illuminant is not close to the ‘daylight’ or ‘black body’ models. For example, Tungsten lighting is ‘black body’, but fluorescents and LEDs have spikes in their spectra.

Compare here:
https://www.researchgate.net/figure/Emission-spectra-of-different-light-sources-a-incandescent-tungsten-light-bulb-b_fig1_312320039

The Tungsten lamp has a smooth spectrum, even though the distribution is not uniform; sunlight varies, but not abruptly; it’s the LEDs and the fluorescents that have huge spikes.

2 Likes

Thanks to everyone for their example sidecar files and all of the links to videos and other resources. One very useful tip in one of the recommended videos was to import the jpeg and take a snapshot. At this point, I’ve been able to get the colors of the reflected lights where I want, at least for the second image I posted (building at night in Lisbon). To get what I wanted, I ended up adding a second instance of color balance rgb and used a drawn mask to apply it only to the sidewalk.

Unfortunately, now the problem I’m having is that the building façade looks terrible compared to the jpeg no matter what I seem to do in darktable. Here’s an example, with a snapshot of the jpeg on the left and my darktable edit on the right. Somehow the right side looks way less crisp, like there is color noise or something. On the jpeg, the dirt in the mortar between the stones really pops. I’ve tried a bunch of things, from local contrast to sharpening to denoising, but I no matter what I do I can’t get the stone to look nearly as good as the jpeg:

I’m not posting a sidecar file only because it looks like this in all of my attempts to edit the file, so I don’t think it’s necessary and don’t know which I would post. I will post my final edit and what I learned from this whole process. (This particular screenshot is from a version with 8 iterations of 512-pixel guided-laplacian highlight reconstructions, which does a great job of recovering what’s in the windows, but you can just open the raw file and see the same undesirable haziness of the building wall.)

Does anyone have suggestions on how to get darktable to make the wall look as crisp as the jpeg? Thanks.

P.S. I should add that I did try haze removal, and it made the mortar pop, but then gave the stone even more weird color noise.

1 Like

Try the dehaze preset of diffuse and sharpen…see if you like that… if you have room to boost it then you can try extra iterations. There are other ways to tweak D&S and other presets but it should give you what you need… local contrast in bilateral mode with a high strength ie 200 300% or even higher with very small settings for coarse and contrast can also raise a lot of details…

Thanks. The problem with all of these things is that the more I make the mortar pop, the more weird color artifacts I get in the stones. Here’s what I get with the dehaze preset of diffuse and sharpen:

It looks to me almost like there are splotches of yellow or something in the pink stone, whereas the hue looks nice and even in the jpeg.

very hard to say but looks like color noise… maybe if you use the denoise profiled… adjust the protect shadows slider and see where that leaves you…

Yes, that is actually better, though I had to turn the strength way down to 2.41 and preserve shadows all the way up to 1.8:

I still think the stone looks a lot better in the jpeg, but have a hard time understanding/articulating why.

I think the jpg has more saturation and contrast - I’m not sure whether more local contrast (could be applied with diffuse and sharpen or local contrast) or or more overall contrast would be better.
My approach is to increase contrast globally (I use sigmoid but I think the contrast slider in color balance rgb might work well too), then use tone eq to pull the highlight and shadows back in.
I just reopened the edit I did before on this image, turned on profiled denoise, and noticed that it hasn’t got a noise profile for this camera. For most cameras it will automatically go to decent settings, but with this one (maybe too new?) you have to set it manually.
Anyway, here’s a screen grab of that bit on my version.
image

I didn’t worry too much about the highlights though, as I didn’t feel they added much to the image. I’m not sure how much this affects things.

Edit: just pulled the highlights back a bit more with a second instance of tone eq, also tweaked the highlight saturation down a tniy bit in color bal rgb.
image

Ya it depends on the image for sure I often use the denoise at a strength of less than 1 and even as low as 0.25 if I am doing luma denoising as it can be hard on details… I sometimes will use only the chroma preset and adjust that as needed to just remove the noise… The I will use surface blur which is really the old bilateral denoise and astrodenoise which is a non local means method… I find these are good for fine noise… you can also use the contrast eq to tweak noise …so there are a wealth of methods… The youtube videos… I think there are 3 maybe 4 on denoise and the chromatic aberration made by rawfiner the module author… the one he did for v 2.6 of DT is very nice and explores denoising in great depth showing all methods that have since been refined but the approaches demonstrated can still be used…

Okay, thanks to everyone’s help, I have an edit that I think rivals my camera’s jpeg in terms of vibrance. (Maybe I even went overboard, but that’s a different discussion.)


lisbon_night.xmp (13.5 KB)

Here are the various things I ended up doing:

  • I just set the white balance by hand in color calibration until the side of the building looked like approximately the same color as the camera’s jpeg (conveniently using a snapshot of the jpeg to compare).
  • At 400% magnification on the side of the building, used denoise profiled (despite the lack of a profile for my camera) with wavelets, a lowered strength of 0.2, and increased preserve shadows of 1.80 to get rid of the annoying color noise in the wall.
  • Darken a bit by increasing white relative exposure in filmic rgb.
  • Used a second exposure with a path drawn around the shadow just to darken the sidewalk a little to make the colors pop more.
  • Used the dehaze profile of diffuse and sharpen with a mask that applies mostly to the building to bring the texture back to the building wall, and give a sense of depth for the building behind the tree.
  • Used the surface blur profile of diffuse and sharpen on the lower part of the picture to blur the sidewalk slightly, so as to avoid drawing attention with the texture. Used a drawn and parametric mask to exclude the reflected lights.
  • Starting with the vibrant colors preset of color balance rgb: first reduced the mask middle gray fulcrum and contrast fulcrum so that the reflected lights are entirely within highlights. Then increase contrast and global saturation to get things really colorful. Increase brilliance of highlights and decrease for midtones and shadows to add even more contrast.
  • Finally, because I wanted that reflected tail light to pop, I just used a display-referred color zones with a drawn mask to shift the color from orange to red.

The one thing I really couldn’t understand about the camera jpeg is how the illuminated tree at the right edge of the photo is completely red. It almost seems like an error, except I like the effect of the red tail light on the left and red tree on the right. Does anyone understands why my camera might have done this and how to replicate it in darktable.

Anyway, I’m still learning, but at least now like my edit more than the camera’s jpeg. If anyone has more suggestions please let me know. I still need to get a better understanding of color balance rgb. I now understand technically what the different controls do, but I still don’t have a good sense of, say, when creatively you want to use saturation rather than chroma, or chroma rather than vibrance. I’ve watched a ton of Boris Hajdukovic videos, and every time that he goes into color balance rgb and starts clicking it feels like magic–I see what he does to make the colors look great, but I have a hard time understanding why he chooses, say, to increase global chroma and then decrease saturation in the highlights rather than vice versa (increase global saturation, decrease chroma).

1 Like

Well, I don’t know what to do. I showed the images to non-photographers and got completely rejected–people really prefer the jpeg to the edited raw. In particular, one thing people pointed out is how much more detail the jpeg seems to offer in the highlights compared to the darktable output. Indeed, the curtains and the plants on the balcony show way more detail in the jpeg than in darktable.

Here’s a blow-up of Sony’s jpeg:

Here’s what I’m getting from darktable:

I tried fiddling with diffuse and sharpen, even adding local contrast on top of diffuse and sharpen, disabling denoise, playing with contrast. I just can’t replicate those crisp vertical shadows in the grooves to the right of the left window, or the detail in the folds of the curtain, or how sharp the plants are.

Is it possible that Sony just knows their camera sensors better than anyone else, so third-party raw editing can be better for creative choices but is never going to beat the jpeg in terms of fine detail for approximately properly exposed photos? The bummer is that I wasn’t pixel peeping when I got this feedback. I showed the photos full screen on a 14" laptop (in portrait mode, so with lots of wasted space), but someone was easily able to see the lack of detail in the window.

Just look at the saturation…way too much in DT in your highlights in this region compared to you jpg…draw that back and balance your exposure and see where it is… also what xmp goes with this edit… share that and we can see what modules and settings you are using for this example…

I can’t recall if I submitted an edit but I was looking at your comment about the red in the tree and was playing around the other night…just opened DT and looked at where I left the edit… seems like lots of detail similar to your jpg example in my version and I am not sure I was even trying to address that aspect… Color may be off as I was messing with that but for sure lots more detail on those curtains is not hard to get…

I think, from when I had a go at this image, that it’s partly down to highlight hue shifts - sigmoid can replicate this btw - and partly down to something like the camera profile. It’s pretty easy, although a bit unintuitive to shift colours a little in color calibration with the channel mixer, which effectively is tweaking the color matrix or whatever it’s called.
IIRC I did that in the edit I posted on this thread, so I won’t try to explain at this point… :sweat_smile: Happy to answer any questions though!

I had sort of landed on this lighter version a few days ago and the windows were not as warm as your edit.

Or it could simply be a bit darker


Obviously when you have lights then wb and exposure are going to impact the look so you could make this more yellow very easily…

20221106_0058.ARW.xmp (11.7 KB)

Sorry I forgot to specify it was the same xmp I posted here:

I did play with saturation, as well as adding a little cyan to highlights in the 4-ways tab to my highlight colors to match. I only posted a snapshot from the previously posted xmp because nothing I did improved things. Would you mind posting your xmp?

It was in the post… I think the first one had an exposure of 1.7EV… the xmp was likely updated to what i used for the lower one… maybe default 0.7 ev??

That could be Filmic.
Try to play with the following: Shadows - Highlights Balance in the Look tab, Preserve Chrominance and Contrast in Highlights in Options.

The highlights of the JPG are brighter, so contrast is higher. There is not much real detail in those curtains, so don’t try to preserve too much. The higher retained saturation also means more colour casts – see the greenish tinge on the window frames.

Okay, my new strategy is:

  • Absolutely crush the highlights with tone equalizer to recover detail in the windows and curtains.
  • Use a color balance rgb with a mask to boost the midtones of the reflection on the sidewalk. Also just a tiny bit of hue shift to make the red redder and the green greener.
  • Use a second color calibration with a drawn mask to make the tree and lighting a bit red on the right-hand side.
  • As before, sharpen the building with diffuse and sharpen.

I’ve found at least one person who prefers the latest image to the jpeg. The one thing that looks better to me on the jpeg is the car–somehow the door handles pop out more and the car is less red in the jpeg. Other than that, maybe this is a decent edit?


lisbon-2colorbalance.xmp (13.7 KB)

Any feedback appreciated.

1 Like

It looks good to me! Having said that I liked your last one too. :+1: