Imaging Glossary › Auto White Balance
Cameras & Sensors

Auto White Balance

The gray-world guess that quietly removes your stain

View
Definition

A camera mode that sets the color gains automatically, usually frame by frame, by assuming the scene averages to neutral gray (the "gray world" assumption) or that its brightest area is white. That works for everyday photographs. It fails for stained tissue: a field full of hematoxylin and DAB does not average to gray, so auto mode shifts the colors until it does, quietly removing part of the stain signal — and by a different amount in every field, depending on how much tissue it contains.

For any image that will be measured, turn auto white balance off, set a manual white balanceLoading... on blank glass, and save it with the acquisition settings.

What the camera assumes

Auto white balance has no reference to look at, so it assumes one. The commonest rule is gray world: the average of the scene is neutral, so the camera scales its channels until the mean red, green and blue are equal. A second rule, white patch, assumes the brightest area is white. Many cameras combine the two, and most apply the result continuously, recalculating on every frame or every few frames.

For an everyday photograph, a varied scene of many colors, the gray-world average is often close to neutral and the guess works. A microscope field is not a varied scene: it is dominated by one or two stains, so the assumption is wrong before the first frame.

Simplified

Automatic color mode has to guess what white is. Usually it assumes the picture, averaged together, should come out gray, and adjusts the colors until it does. It keeps doing this for every new picture.

That guess works for holiday photos, which have lots of different colors. A stained tissue section is mostly two colors, blue and brown, so the guess is wrong from the start.

Why it fails on stained tissue

Take a field that averages R 150, G 120, B 110, a typical brown-and-blue tissue field. Gray world scales the channels to their common mean of about 127: gains of ×0.84, ×1.06 and ×1.15. Blank glass that was already balanced at 230, 225 and 228 becomes 194, 238 and 263, so blue now clipsLoading... and the glass turns blue-green.

Every color in the field shifts the same way, partly removing the stain the camera was supposed to record. And because the correction depends on how much tissue is in view, it differs from field to field: a sparse field and a dense field of the same slide get different gains, and the same cells measure differently depending on their neighbors.

Simplified

Show the automatic mode a field full of brown and blue tissue and it decides the whole picture is too warm. It cools everything down until the average is gray. Empty glass, which was correct, turns bluish, and the brown stain gets weaker.

Worse, it does this differently for every field. A field with little tissue and a field packed with tissue get different corrections, so the same kind of cell measures differently depending on what is around it.

Turning it off, and making sure it stays off

Switch the camera to manual or fixed white balance and set it on blank glass (see white balanceLoading...). Then check it held: image a field of blank glass and a field crowded with tissue, and compare the glass in both. With a fixed balance, the glass reads the same in each; with auto still active, it shifts between them.

Some cameras and acquisition programs restore their default mode when they restart or when a profile is loaded, so make the check part of starting a session. Save the white-balance mode with the acquisition settings, not just the gains.

Simplified

Set the camera's color to manual, and set it on empty glass. Then test it: take a picture of empty glass and one of crowded tissue. If the empty glass looks the same color in both, the automatic mode is really off.

Some programs quietly switch automatic mode back on after a restart, so do the quick test at the start of every session.

Share This Term
Term Connections