Multi-area white balance tool

(Carmelo Dr Raw) #1

The Raw processing module has recently gained a new tool: a multi-area WB.

This new WB mode allows to compute the white balance coefficients by averaging several rectangular areas across the image. The resulting average is weighted according to the size of each area, so larger areas contribute more than small ones (proportional to the number of pixels in each area).

When the tool is activated the first time, and no areas are yet defined, a square around the mouse pointer suggests the placement of the first WB area. Once the first is placed, additional areas can be inserted with a Ctrl-Alt-left mouse click.

Existing areas can be moved by left-clicking anywhere inside them and dragging with the mouse.
Areas can also be resized by dragging one of the four red corners.

Finally, areas are deleted by right-clicking inside their rectangular region.

Here is a screenshot showing the new tool in action:

As usual, updated packages can be downloaded from the github site.

Any feedback is welcome!

(Morgan Hardwood) #2

Hello @Carmelo_DrRaw

Walking through the woods I pondered how I would explain to someone how to set a white balance for a photo where half of the scene is in sunlight and half is in shade. Imagine you had a grey card in both sunlit areas and in shade - which one do you pick the white balance from? I think in the end the best indicator for which one to use is to see what light the subject of the photos is lit by. If the subject is a person standing in the shade where half of the photo is in direct daylight, then pick the white balance from the shaded grey card.

And so I’m curious - what would using your tool do? Let’s say picking shade sets the WB temperature to 7000K and sunlight to 4000K. What would picking both do in Photo Flow?


@Morgan_Hardwood When I requested this feature, I didn’t ask for multiple patches, just the ability to draw a rectangle or arbitrary shape around an area. This implementation changes things as you have pointed out. I haven’t thought this out but multiple patches are still useful in the case where the user isn’t sure which patch is ground truth neutral, so he or she might want to select a few for the tool to deliberate over.


But if the subject is the only one illuminated by a setting sun in front of a shady background I would choose the background for the white balance.

(Carmelo Dr Raw) #5

Honestly speaking, once the area-WB was implemented it has been rather straightforward to give the possibility to use multiple areas…

Probably the use of more than one area is rather limited, for example in cases where averaging between patches that are not nearby is needed. As I am not able to anticipate all possible uses of the tool, I simply decided to make it flexible.

I am now working on adding the same functionality to the separate white-balance tool, which is something probably more interesting.

In cases where the color temperature across the image is not uniform, it is possible to do a first adjustment of the WB in the RAW processing module, then add one instance of the WB tool layer where a second WB is applied, and then blend the two with a mask (gradient, luminosity mask, or any combination of masking tools…) such that the colours get harmonised.

This is already possible with all other WB modes, only the “area WB” is still missing from the WB adjustment tool…

(Morgan Hardwood) #6

How is it averaged?

(Carmelo Dr Raw) #7

Currently I am making an average which is weighted with respect to the surface (in pixels) of the areas. So if you have two areas, one of which is twice the other, the formula is

WB_avg = (WB1*2 + WB2*1) / 3