Need help with white balancing

What version of DT are you using and can you share your xmp?? Edit I took a quick look at the embedded JPG…ie I would guess your reference??
20221231-1613-7571.raf.xmp (8.7 KB)
Here is a quick xmp from an edit but there are many ways to treat the blue and to end up at what you might think is pleasing…my edit is a bit lighter than the jpg which would impact it and i used gamut compression in CC module which depending on how hard you push it will leave more blue or slowly dumb it down…

1 Like

Hi, I would have preferred to see what you got.
But here is what I get to see if it would work for you.
this is just a quick test.
the xmp file of your raw.
20221231-1613-7571.raf.xmp (11,5 Ko)

your direction is clear but are you hoping for people to share edits with you and if so you will need to add the CC license and specify that you are looking for advise as is done in the playraw threads… I just shared back an xmp and I have deleted the image … Options you might grant are summarized here…


It’s those blue LEDs again… I don’t fully understand it, but they seem to cause really hard clipping in the blue channel. The best solution I’ve found is to got to the ‘colorfulness’ tab in color calibration, and pull the blue slider down. makes a world of difference on a shot like this - IMO.
Here’s my xmp which is very basic, I haven’t applied any denoising or anything. Should also say that I’m in legacy mode for white balance so the CC module isn’t doing anything else, but it should work just as well with modern wb I think.
edit: Sorry forgot to attach the xmp!
20221231-1613-7571.raf.xmp (7.4 KB)
edit no.2 I think the BW is fine as is, btw.
Another attempt, a little more polished.
20221231-1613-7571.raf.xmp (7.7 KB)

1 Like

That LED-blue is an extreme hue, way out of gamut for sRGB. It has to be down-transformed in a way that makes an equivalent gradation in the sRGB gamut, and a matrix camera profile (which is probably the darktable default) doesn’t do that. I think this is why AP incorporated the chromatic tool in filmic, hoping to present the sRGB transform with out-of-gamut hues already gradated thusly.

I processed the raw in rawproc and replaced the matrix transform with a LUT profile for the X-T30 camera (close enough for gov’t work?) and the LED blues looked better…

I extracted the preview JPEG from the RAF, it appears to have similar treatment.


This is not a white balance problem. You have captured a really vibrant blue color. One way to reduce the saturation of the blue (even the lightness if desired) is to use the color zones module. See attached images of how I reduced the blue on the bubbles.


1 Like

The gamut compression slider in CC also works wonderfully on this… it starts with a max soft boundary of 4 but you can push it higher and it works nicely on these gamut issues…


Color Zones isn’t enough in this case. You have to use masks I think - especially to keep the rest of the pic in the original mood:

20221231-1613-7571.raf.xmp (16.7 KB)

Those bubbles look good! I didn’t try masking… this is a similar snippet from my last edit above, no masks, just color calibration tweaking, both colorfulness and channel mixer.

@123sg Do you have a xmp. I’m interested how strong the rest of the pic is affected, if you reach this without masks.

Yes, it’s this one. I think if there was a lot of blue in the image it might not work, but to me in this case it works quite well.


You can also try the “color lookup table” module (patch #12, carefully adjust lightness to taste):

20221231-1613-7571.raf.xmp (15.2 KB)

Another attemp
20221231-1613-7571.raf.xmp (14,7 Ko)

I will use this image for potential future development efforts if that is ok for you! Good case of problematic colors that are hard to handle.

1 Like

right. to give you an idea how bad a matrix profile fares on colours like this, here’s the cie plot:

see how in the blue corner (bottom left) everything goes way out the window? you can of course clamp these values to sane gamuts, but doing any kind of compute with these values is necessarily going to be rubbish (negative luminances are a common result).

here’s the plot with a lut profile estimated from the dng matrices for D65 and Illuminant A:

white balance is at 6504 (daylight) here, it gets a bit bluer if i go more towards tungsten, but will not break.


How do you display the cie plot?

in vkdt, replace the hist module between the output you want to visualise and the display:hist instance by the ciediag module. just like the hist module reads input and renders a waveform histogram, the ciediag module will render the cie chromaticity diagram.

edit: looks like this:

1 Like

My version…

Captura de pantalla de 2023-01-05 15-58-02.png

20221231-1613-7571.raf.xmp (17.0 KB)

1 Like

Thanks a lot to everyone. This has helped very much.
Please see attached my take on this.
20221231-1613-7571_02.raf.xmp (8.1 KB)
I have used the same settings to this picture as to all other pictures from this series but I have added the Color Calibration Modul. Raised Gamut Compression to 3, reduced colorfulness by -0.3 and added +0.1 brightness for the blue channel. Yes, it changes the overall look but that is acceptable for such a quick fix.

1 Like

With very strong gamut compression:

With less severe compression:

Processed in OKLab, using the toy code from Mapping to output gamut