Copy-paste manual white balance

With the traditional WB method (RGB multipliers only, so white balance module without color calibration), one would pick grey from a card, and copy-paste the multipliers across a sequence of images.

Here are two images. Both have the grey card (for comparison), but the idea is to pretend the 2nd shot does not have it, and we’d like to use the WB from the 1st image.

If I go with ‘legacy WB’, disabling color calibration, picking WB multipliers on the first image, and coping that to the second:

  • first image after picking ‘legacy’ WB:
    image
  • copying those values to the 2nd image, the card is not perfectly neutral, but I think the WB would still work pretty good, if this were a real shot when I no longer had the grey card:

    It is certainly much more accurate than what the camera came up with (white balance: as shot to reference + color calibration: as shot in camera):

How to do that with the modern workflow?

  • by default, white balance is based on white balance: as shot to reference + color calibration, where, if I’m not satisfied with the camera’s WB, I can pick a value from the card in color calibration.
  • now, how do I (would I) transfer white balance from the first image to the 2nd?
    • On the first image, the one with the grey card and no mug:
      • white balance: as shot to reference indicates temperature: 4976 K and tint: 0.997, or channel coefficients red: 2.414, green: 1, blue: 1.98),
        image
      • and (after picking from the card) color calibration shows illuminant: custom, hue: 62.3°, chroma: 17.5%:
        image
      • As confirmed by the colour picker, the grey card is really neutral after this:
        (it won’t appear neutral here, because the image was captured using my monitor’s colour space, but I did not tag it as such, and did not convert it to sRGB, either – being lazy)
    • On the next image, taken seconds later, but with the mug added, and my shadow falling somewhat differently to the image:
      • as shot to reference indicates temperature: 4787 K, tint: 1.001, channel coefficients red: 2.344, green: 1, blue: 2.035:
        image
      • color calibration: hue: 61°, chroma: 18.1%.
        image
      • again, the WB setting is very good:
    • But if the 2nd image did not have the card, what would I copy from the first?
      • if I copy white balance and color calibration, white balance is way off (left: this method; right: with WB + color calibration picked from this grey card, show above):
      • if I reset white balance to as shot to reference (it gets copied and pasted as user modified), keeping color calibration on the custom-picked-copied-and-pasted values, the result is better, very close to copying and pasting values with ‘legacy’ WB (there, the ‘a’ and ‘b’ values were 0.13 and 0.25, almost the same as the 0.16 and 0.23 we got here). The result is the same if I only copy-paste color calibration from the 1st image:

So, this works quite well, but the whole process is a bit suspect to me.

1 Like

I am interested in hearing what more knowledgeable people say about this issue. I suspect I would be lazy and take the easy way and only use the WB module and disable the color calibration module if working with a grey card. I am not sure what advantage the color calibration module brings to the process if using a grey card for WB. But I am here to listen and learn.

I guess the benefit is the same: instead of taking a simple linear approximation to white balance, the LMS spaces used for chromatic adaptation model human vision more closely (at least that’s the way I understand it). BTW, happy new year – it’s 00:06 here. :smiley:

2 Likes

For me this was a good article on the subject of CAT…and section 5 deals with WB and matching viewing and scene illuminants…the math is a bit different in DT I think but the process to get wb or in place of doing standard wb would be as described there…

1 Like

I’m not sure I’m properly understanding the issue here, and it’s late, however…

@kofa , you mention the shadow is different in the 2nd image, so is it simply that you have two differing white balances and so copying settings is not the best way to proceed?

I have always thought the DT “modern workflow” was to use “camera reference” in the WB module and adjust the balance in Color Calibration. Then the “as shot to reference” development came along and I think you know my thoughts on that.

OK, it was a long post, and I failed to provide a concise summary of my root question - so here it is:

  • ‘modern’ white balance is made up of two steps: white balance = as shot to reference
  • color calibration (either with the defaults or manually set / picked correction)

When I pick WB (in color calibration), I feel it’s weird to only copy the picked color calibration values. Maybe the lighting in the scene does not change at all between the two shots, but the scene itself changes (framing, movement in the scene etc.), which may cause the camera to pick different multipliers in white balance.
However, one cannot copy the multipliers from the 1st shot to the 2nd, as that no longer counts as as shot to reference white balance, and the overall white balance will be incorrect (see

if I copy white balance and color calibration, white balance is way off

above).

So that’s my dilemma. It’s probably no big deal:

  • I very rarely do this (it came up because I wanted to take such a series now)
  • I can always fall back to ‘legacy’ for such shots and copy multipliers directly
  • even if I only copy color calibration, since the white balance (as shot multipliers) in such a series are unlikely to change significantly anyway), the result is about as good as copying the multipliers with ‘legacy’.

A more general extension would be (even for a single image):
Would it be possible to enhance the process in a way that if one can use a grey card (or any other method) to pick white balance, use that user modified white balance the same way in-camera multipliers are used with as shot to reference (values picked by the camera)? I don’t see much of a difference; if I first set WB in camera using a grey card, and then take the picture, the multipliers would be the same. This would make any small errors in in-camera WB disappear right at the start, giving even better results for highlight reconstruction, raw chromatic aberration correction, demosaicing etc. (See why as shot to reference was introduced in the first place, to replace camera reference: Introduce as-shot to later D65 workflow (improved highlights) by jenshannoschwalm · Pull Request #15602 · darktable-org/darktable · GitHub).

I guess I’ll open a feature request, and see what the developers think.

Update: Use _user modified_ WB multipliers with modern chromatic adaptation · Issue #18126 · darktable-org/darktable · GitHub

I support this feature request, it’s good.

For total clarity, and people new to DT: The driver for “as shot to reference” was that some modules work best with accurate white balance values (highlight reconstruction, raw chromatic aberration correction, demosaicing are mentioned above); while others work best with D65 values aka “camera reference”. Previously both sets of modules used the same values, which obviously is not ideal. A new option, “as shot to reference”, was brought in whereby the camera’s white balance was used for the first group, and D65 was used for the second group. This was fine if you had properly set the white balance in the camera or were happy with an “auto” setting in the camera. BUT if you carefully adjust the balance in the White Balance module, perhaps using a grey card, then the values become labelled “user modified” and the improved processing does not apply.

@kofa, perhaps the “from image area” option should also benefit from a revised process?

As a side note, I think the design of the WB module was a bit flawed right from the start. It records the three coefficients in the history but not the user’s intention as far as I know, e.g. you might select “daylight”. Suppose you’re doing wedding photography with two Canon cameras, and now you’re processing in DT with groups of similar shots. You choose daylight for one camera, all is fine, then this is copied to the other camera’s shots and it looks wrong. The three coefficients for Canon “daylight” vary across models. If the history had recorded the daylight intent, it would have been able to apply it correctly for the second camera.

As for copying modules such as WB and Color Calibration, rightly or wrongly I don’t do this. If I have a group of similar shots, I work on one with basic settings - colour balance, contrast, exposure, some colour adjustments maybe, maybe denoise etc… then use “load sidecar file” to set up the rest of the group. I have to keep an eye on ISOs in case the white point needs adjusting though.

I recall we participated in the discussion when the feature was introduced and for me I was still left wondering why it had to be tied to as shot other than to have something that was consistent. I totally got the using wb for the early initial processing of the raw and then on to reference values but I could never understand why an intentionally corrected wb could not be used.

The recent play raw with the bird sculptures flying had incandescent wb for an outdoor shot and thus for as shot and was extremely blue. I would think that being able to first correct that to provide a better wb for the modules using wb would be superior to starting with this value .

I would have to go back and see why it is not an acceptable option…

1 Like

If you keep a fixed WB on camera?

If I shoot raw and I have a grey card, I don’t want to fiddle with in-camera white balance settings.

What may work is pick WB in white balance, and use illuminant: D50 (same as pipeline) in color calibration. Those can then be easily copied to all files.

1 Like

I have related, but slightly different use case.

I have created customized D65 coefficients that provide better color reproduction than the system camera reference, and apply them as a preset for that camera. I haven’t used the “as shot to reference” option, as I’d prefer to use this WB setting in the later modules, and I haven’t figured how that would be possible.