Setting temperature to default value in color calibration module leads to cast

I noticed that when using the color calibration module that when setting the temperature in the module to the exact same value as the default and changing nothing else, a color shift occurs which can be seen in both the histograms and in an observable green cast in the image. I saw that there has been another post about a green cast with the color calibration module, but it appears to be a different issue.

This seems like undesired behaviour, but perhaps I am not understanding something about how the module works? I am happy to provide example images and/or screen shots if this is not able to be reproduced easily.

I am running the most recently released version of Darktable (3.4.1) on Arch Linux.

Are you sure you are using modern color workflow?

At least, make sure that in the normal white balance module the balance is set to ā€œcamera referenceā€, then do your white balance / color balance from the color calibration module.

From what I’ve understood, there were some bugs with d65/d50 differences in the color calibration tool which have been fixed in development version towards 3.6. But I don’t know when and how these might show up.

The K values in color calibration don’t really mean anything…so if you set it to 5000 K or some other desired WB you might introduce an unexpected cast. I am not the one to explain this properly but this is not a traditional WB linked to K values. I will see if I can find you the reference…If the initial default calcultated by CC is not what you want use the picker on a neutral element or change the selection to custom for the illuminant and you will get a hue chroma slider pair. Usually just tweaking the chroma of the calculated hue will dial in your WB.

https://darktable-org.github.io/dtdocs/module-reference/processing-modules/color-calibration/

EDIT…
Quick explanation in this comment. Also a ton of information in the entire thread

In the settings I have selected the modern colour and scene referred workflow. If I double check that I am starting from a fresh history for an image that it still occurs. I can also confirm that the white balance module is set to camera reference. I observe this in every single image I process.

I understand that the numbers don’t really have a clear meaning, but the point here is that typing in exactly the same number that is apparently the default value that was either calculated or obtained from the metadata for an image does not result in the image staying the same, but instead introduces a cast. Note that this default value is different for each image. This means that if I am nearly happy with the default but want to every so slightly change the slider one or the other direction, it is not possible.

To be totally clear, I am talking about the default temperature in the color calibration module; I am not at all looking at the white balance module, I am just leaving it on the default camera reference. The color calibration module is active and I can type in the temperature it says it is using and the image changes, and when I click to restore to default it changes back. This appears to be different from the linked thread, where the comparison is being made to the temperature from the white balance module.

The color calibration has more settings than just temperature.

By default it appears as ā€˜pick from camera’ or something. When you ā€˜reset it’, it might not reset to that starting point, but to an empty point.

There is a key to hold to ā€˜reset to auto defaults’ which is different from ā€˜reset to defaults’… holding the ctrl key on windows at least.
image

Also, if you want to go back to how your camera took the shot, you can ā€˜reset to auto defaults’ but you can also pick the ā€˜as shot in camera’ option from the illuminant menu:
image

If the ā€˜adaptation’ is set to ā€˜none’, you first have to pick something, and then pick ā€˜as shot in camera’ again.

I do understand that there are more settings than temperature. But I think you have found the root of the issue: the default setting for illuminant is ā€œas shot in cameraā€, but if you select that and then hit ā€œreset to auto defaultsā€ it changes the illuminant displayed in the GUI back to daylight, even though it is actually not using that. I do think this is misleading behaviour, as it implies that the default setting is the daylight illuminant with the temperature it has calculated and set in the slider.

Thanks for your responses; I was feeling not confidant about using the module because I thought I had found a bug.

1 Like

I don’t think I see that when I use the modern WB setting?? Maybe share an image??

I am experiencing difficulties using the dropper in the color calibration module when trying to set a white balance in this way.

I have used the color picker to analyse what is happening and found there to be a value of zero in the reds in the image.

Any help with this would be greatly received

Have you changed the color manually at some point or done color matching… Before picking the values should be 50 0 and 0 (LCH) for the reference illuminant to correctly set wb. If you have modified that then your wb is not using the right base setting…and you can get bizarre results

EDIT:

If you open up the color mapping section can you check to be sure that it looks like this and not some other values…

1 Like

Not sure what you mean. Can you provide some examples?

1 Like

Thanks Todd.

You nailed it with the color mapping-I was unaware I had altered the values from 50. 0. 0.
They are now set correctly and the dropper is behaving predictably and well.

I have a further query regarding the old white balance module working in conjunction with the colour calibration module.

I have attempted to use the colour calibration module without applying the white balance module in order to prevent circumstances in which the white balance applied twice warning appears.

All functions of the calibration module work well apart from the ā€˜as shot in camera’ illuminant option.
In this instance, ā€˜white balance successfully extracted from raw image’ is displayed on the image but it is all green. However if I either toggle the ā€˜correction’ option in the area color mapping or uncheck and check the ā€˜take channel mixing into account’, the correct camera white balance is applied.

Furthermore if the white balance module is active and set to camera reference, the as shot in camera option works normally.

I guess my question boils down to is it necessary to have the old White balance module turned on and set to camera reference in order to use the colour calibration module

The short answer from me because you asked and for sure I am not likely qualified to offer it but here goes is. You need the wb module. It is used in the early stages of raw processing to scale the conversion of the channels captured on your sensor. If you turn it off you get green as that balancing is no longer there. I could then go in to the whole processing of the image is some detail but I don’t think you need that…It may be a coincidence that you can get to a decent image without wb but you are likely asking the module to correct for a green illuminant and that’s not likely always going to holdup.There could be other implications for highlight reconstruction or other processing steps…

Leaving that aside I would say use the defaults…so set wb to the most right hand option…depending on your version of course but currently that woudl be as shot to reference… Then use CC module with either the default or picker to set the illuminant. Then to further modify after that whatever option the module lands on change the drop down to custom. Initially this will change nothing but will give you hue and chroma sliders… For me what I do is usually leave the hue alone (although as you get comfortable you might make some adjustments there) and just move the chroma slider… If you have a warm scene and it have been corrected to neutral and you want a bit of that back then just ease off on the chroma… and the reverse if you need a bit stronger correction boost the chroma a little… Use your eyes and don’t worry too much about the numbers.

As for the error if you know what you are doing and say use two instances of CC for a complex light situation or something of that nature you can just ignore it or turn off the warnings in preferences…

WB is considered a partial chromatic adaptation transform for an image. Using the workflow in DT with the CC module you are correcting for the scene illumination to create an output where under your display conditions neutral object will in theory appear neutral under display conditions which are often quite different from the scene…

For context, you can scan this reference…section 5 refers specifically to WB. Depending on your interest and background there is some math but I think you can read past or through it and just look to it as more of a ā€œconceptualā€ explanation of the process… or ignore it :slight_smile:

1 Like

Perfect.
Thankyou so much
I will read the Yuhao Zhu article some time but for the time being, your simple answer is all I need.

For what it is worth there is nowhere in the darktable user manual that explicitly states that to use the ā€˜as shot in camera’ option in colour calibration the white balance module must be active.
I think such a statement would be helpful to users.

The manual has fallen behind for some things so it’s a matter of knowing where and how to follow the DT development for many things esp recent changes… maybe not ideal but there have been several request and or calls for help to try to keep the documentation current….much of it was falling one one or two people ….

The first section of the manual entry for color calibration states (first bullet)

To adjust the white balance (chromatic adaptation), working in tandem with the white balance module. Here, the white balance module makes some initial adjustments (required for the demosaic module to work effectively), and the color calibration module then calculates a more perceptually-accurate white balance after the input color profile has been applied.

The second section (second paragraph) states:

Chromatic adaptation is controlled within the Chromatic Adaptation Transformation (CAT) tab of the color calibration module. When used in this way the white balance module is still required as it needs to perform a basic white balance operation (connected to the input color profile values).

While neither of these paragraphs uses the words ā€œappliedā€ or ā€œenabledā€ it seems self-evident that a module must be active in order to do anything.

Thanks to Todd’s response I now understand how to use the white balance module in conjunction with the colour calibration module to good effect.

I read and reread the paragraphs you quoted above before asking for help here.

I am sorry but it was not self evident to me that the white balance module needed to be active in order to access the as shot in camera white balance setting when using the colour calibration module.

I think the reason for my uncertainty was due to the appearance of the white balance applied twice warning.

The warning appears unless as shot to reference is selected in the white balance module.

1 Like

Second section of the manual again:

By default, color calibration performs chromatic adaptation by:

  • reading the RAW file’s Exif data to fetch the scene white balance set by the camera,
  • adjusting this setting using the camera reference white balance from the white balance module,
  • further adjusting this setting with the input color profile in use (standard matrix only).

Also, in the ā€œCAT Warningsā€ section:

  • If the color calibration module is set up to perform chromatic adaptation but the white balance module is not set to ā€œcamera referenceā€, warnings will be shown in both modules. These errors can be resolved either by setting the white balance module to ā€œcamera referenceā€ or by disabling chromatic adaptation in the color calibration module. Note that some sensors may require minor corrections within the white balance module in which case these warnings can be ignored.

This is one area where we do need to update the manual. While using ā€œcamera referenceā€ in the white balance module does work (and will not show errors), the new default is to set white balance to ā€œas shot to referenceā€.

But essentially, once you have your preferences set correctly, just leave the white balance module alone and it’ll do its thing automatically.

I would certainly like to make this section clearer, but it’s a complicated module and I’d like to do so without losing too much of the useful detail. I’ll have a think about how we can improve it.

1 Like

I think starting with a simple guide of what most users should do if they don’t understand the theory might help. Hold their hand to start with, whilst guiding them towards the information that will help them grow.

2 Likes