An introduction to digital white balance

One of the key strengths of raw photo processing is white balance adjustment. I have found white balance powerful although difficult. This first post details how digital white balance works in low level, using native RGB multipliers, and in high level, using colour temperature and tint parameters in RawTherapee version 4.09. Many other raw photo applications use similar temperature/tint parameters. A second post evaluates white balance in RawTherapee.

Why white balance?

Different light sources have different spectral power distributions. Incandescent lighting has a orange-red colour. Fluorescent lighting can be quite green. The colour temperature of daylight varies throughout the day and is modified by clouds, dust, pollution, etc.

Some example spectral power distributions for standard illuminants A (tungsten), F4 (warm white flourescent) and D50 (5000K daylight). D50 has a relatively even spectral power distribution. A has lots of red (longer wavelengths) and very little blue (shorter wavelengths). F4 has plenty of green, not much red and blue and some scary looking spikes - yuck!

Some example spectral power distributions for standard illuminants A (tungsten), F4 (warm white flourescent) and D50 (5000K daylight). D50 has a relatively even spectral power distribution. A has lots of red (longer wavelengths) and very little blue (shorter wavelengths). F4 has plenty of green, not much red and blue and some scary looking spikes – yuck!

The reflectance spectra of objects change in different light. These changes usually don’t attract our attention because of colour constancy. Human colour perception automatically adjusts for different lighting conditions so that the perceived colour of objects remains approximately constant. Likewise, we similarly expect photographic images to be colour balanced. For digital cameras, white balance (WB) is usually achieved by adjusting the relative amounts of red, green and blue (RGB) for a satisfactory rendering of neutral whites and greys.

Digital camera white balance fundamentals

WB for digital cameras is commonly performed by linear scaling of native RGB levels (i.e. camera RGB before any colour processing). Here are some WB RGB multipliers for a Canon 400D Digital SLR (DSLR):

Canon 400D white balance RGB multipliers read by dcraw 9.16.
White balance multipliers
Preset R G B
Daylight 2.183594 1.000000 1.519531
Shade 2.573242 1.000000 1.267578
Cloud 2.381836 1.000000 1.381836
Tungsten 1.455857 1.000000 2.375212
Fluorescent 1.819611 1.000000 2.107308
Flash 2.432617 1.000000 1.352539

The spectral sensitivities of digital cameras are generally optimised for daylight, but notice the daylight WB boosts the R and B channels relative to G. The camera native response actually has a strong green cast. This can be demonstrated by processing an image in with all WB multipliers set to 1 or by setting a Unitary WB in the camera. Human colour vision is similarly more sensitive to greenish-yellow, so do not be alarmed by the camera native response.

For tungsten WB, notice that R multiplier is 0.67× the daylight value and the B multiplier has increased by 1.56×. WB is counteracting the effect of the tungsten light by reducing R and increasing B. The white balanced RGB response should approximate the daylight response and a daylight camera input colour profile may then be applied. Take a moment to review the other RGB multipliers and you will appreciate the large differences in the native RGB response for different lighting conditions.

White balancing native RGB may seem crude, however a research paper by Viggiano (2004, SPIE 5301) reported that colour differences were acceptably small (mean deltaEab = 2.81). The catch is that the illuminant is generally unknown. From the camera native RGB data it is not possible to determine both the properties of the illuminant and the scene. Methods for estimating the illuminant are a subject of ongoing research.

White balance in RawTherapee (and most others)

WB with RGB multipliers is not intuitive and most raw photo applications feature only colour temperature and tint parameters – the RGB multipliers are hidden.

Colour temperature in Kelvins refers to a black body that radiates light of similar hue to that of the light source. For example, tungsten incandescent lamps (CIE Illuminant A) have a colour temperature of 2856 K. Direct sunlight (CIE Illuminant B) has a colour temperature of 4874 K. RT actually uses a Daylight-series model above 4000 K and a black body model below 4000 K (RT colorimetry document). The colour temperature parameter basically adjusts the blue-yellow balance.

The tint setting is an extra WB parameter for more ‘difficult’ light sources. For example, fluorescent lamps have spectral distributions very different from a black body or daylight (as illustrated in the figure at the beginning of this post). The colour tint setting basically adjusts the magenta-green balance. Here are some colour temperature and tint settings for my Canon 400D that will help explain:

White balance presets for Canon 400D translated to colour temperature and tint parameters by RawTherapee 4.09.
Canon 400D WB RawTherapee WB
Preset R G B Temp. (K) Tint
Daylight 2.183594 1.000000 1.519531 4921 1.014
Shade 2.573242 1.000000 1.267578 6285 1.011
Cloud 2.381836 1.000000 1.381836 5548 1.012
Tungsten 1.455857 1.000000 2.375212 3148 0.987
Fluorescent 1.819611 1.000000 2.107308 3643 0.883
Flash 2.432617 1.000000 1.352539 5722 1.010

Daylight, shade, cloud, tungsten and flash all correspond to the daylight or black body models and the tint settings are close to unity. Shade has a higher colour temperature than daylight (i.e. image corrected towards yellow, opposite to blue). The reverse occurs for tungsten (i.e. image corrected towards blue). Fluorescent lighting is often rather green and the tint setting is substantially less than unity (i.e. image corrected towards magenta).

A major challenge for software developers is how to convert between high level colour temperature and tint and low level RGB multipliers. My own testing has found systematic underestimation of colour temperature by RT for my Canon DSLRs. Those results are presented in a second post.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: