Why Auto White Balance Isn't Perfect

Every digital camera made comes with a promise of making perfect pictures with the click of a button. This promise is made possible by a considerable amount of computer processing horsepower as well as both simple and complex algorithms for determining a solution to use for the photographic variables of exposure, aperture, sensitivity, and white balance, assuming you haven't overridden these settings with ones of your own. These algorithms, however, are by no means perfect, including the auto white balance algorithm used to process the RGB sensor data into an accurate color image that resembles the scene you photographed.

Oh, come on, surely you don't mean that modern photographic technology hasn't figured out how to set the white balance automatically for every situation.

Actually, that's exactly what I'm saying. Sure, modern electronics do a pretty good job a fair amount of the time. But, there's one thing that prevents auto white balance from doing a perfect job and that is that the data it works with is the light reflected from your subject. Unless the light source is in the scene, there's no way for the camera's electronics to know what the color the light used to illuminate a scene is. And, even if the light source is in the scene, there's no easy way for the camera to say "ah, here's the light source. Let's process the data from right there to figure out what white balance setting to use." Instead, because the light source is almost always never in the scene, the auto white balance algorithm has to guess.

For example, let's look at this photo of Moscone West in San Francisco. There's no particular reason, by the way, for using this photo other than it's one that I'd recently posted to my Flickr account. It's actually a pretty average photo taken in daylight with a blue sky on top and a grey street on the bottom. By looking at the photo, you can figure out the basic relationship of light source to subject to camera and you know it's daylight illuminating the scene. But what does the camera know? Only what it can deduce through its algorithm.

awb_fail

The problem is that until cameras sport artificial intelligence, the mass of transistors and circuits in your hand has no blinking idea what it's looking at. The auto white balance algorithm doesn't know that it's a street scene with a big glass building and cars and a street in it. If it had your brain in there, it'd know that it should process the image data as being illuminated by daylight. Without a brain, all it knows is that it's looking at a big array of RGB data and it needs to make some quick guesses to determine what white balance settings it will use.

Well, that image you used is pretty obviously a daylight image. Shouldn't the camera be able to figure out what's going on by doing some fancy image processing? For example, there's that grey street there...

How smart do you think a camera is? Trying to suss out what part of an image is a neutral grey to use to deduce a white balance setting from is a pretty challenging problem. There are probably as many different white balance algorithms as there are camera makers, maybe more. But, in the end, they all do about the same thing. They look at the incoming data, smoosh it together in some way, look at the results, and then make a guess.

awb_fail_swirl.jpg awb_fail_avg.jpg

It's my understanding that the granddaddy of these algorithms, first deployed in those awesome-for-the-time Kodak lab machines, blended the overall image into a single color and then used that to set a target white balance, as well as many other settings, to make a print that would be acceptable to the majority of the people most of the time.

awb_toowarm.jpg As you can see, the smooshed color value from the scene above is still cooler than neutral and, if you used it to set a white balance setting from, you'd end up with a photo that was a bit too warm, and it'd probably look something like the photo to the right. Come to think of it, I remember sometimes getting photos that looked too warm from those one-hour places. Hrmm....

These days, it's a safe bet to assume that the algorithms used in modern digital cameras are quite a bit more advanced and do a lot of screening out of colors that can be ignored and might even look in the top half of the photo looking for something that resembles a sky or the like. No matter how advanced the algorithm, however, nothing is going to change the fundamental situation at hand. Without being able to see the light source illuminating the subject, the camera will always be making a guess.

Of course, it's easy enough to set a white balance setting manually and with a little practice, you can do a much better job than AWB. You can use one of the presets on your camera, such as daylight when outside and tungsten when inside. Better yet, you can use a tool like a WhiBal or ExpoDisc, which provide great results when you are shooting in challenging lighting situtations. Any of these options takes just a few seconds and will almost always result in a more pleasing solution than AWB.

Related Posts:

This is one of 142 blog posts on duncandavidson.com. If you care to read more, two posts I recommend are Dear Speakers, a set of thoughts for public speakers that I pulled together in March, 2009 and Tilting at the Windmill, One Last Time, a call to Flickr to include important EXIF and ITPC metadata in the photographs they provide to the public.

7 Comments

Great article. I absolutely love the combination of shooting RAW with my WhiBal card. Some see it as extra steps, but I see it as not worrying about my white balance.

user-pic

The problem of the white balance is just an additional aspect of the problem of measuring reflected light that is as old the oldest light meter. With B&W images only the amount of light mattered, with colour images also the spectral composition of the light matters. The spectral composition is summarized in the colour temperature, which assumes a blackbody light source. The amount of light is summarized in the EV value, assuming that the spectral sensitivity of the light meter and sensor/film matches.

In the pre-digital days, either measuring the reflection of a defined target or direct measurement of the incoming light were common. I then usually found measuring the incoming light the easier and more reliable method. In the digital era, live or almost-live histograms can almost completely replace precise light measurements, as it is only important that all import image areas do not have their high-light or shadow details clipped. Everything else can mostly be fixed in post-processing, as a precise reproduction of a scene is rarely the goal and whatever pleases the eye on a monitor in the end is a 'correct' exposure.

In principle, 'whatever pleases the eye' also applies to colours, except that is often much harder to make up ones mind as instead of one parameter in B&W, the 'exposure', one has two additional sliders, colour temperature and tint. Everybody who once made colour prints knew the challenge it was to get the colours right.

My two guides for getting the overal colour right is to look at the RGB histogram, often a correct white balance is indicated by at least a some part of range having almost overlapping curves. The second is look at close but not quite monotonic areas (eg, a green forest, a green meadow) and try to find the colour temperature that creates the highest tonal separation. The reasoning behind this is that with a wrong colour temperature an overall colour cast is covering the whole image which reduces the tonal separation of other colours.

As stated in this blog, measuring the incoming light temperature is the safest way. Unfortunately I found greycards to be a little bit tricky, particularly as higher ISOs are used where colour noise can make the temperature calculated by software very jumpy and unreliable. The best tool would still be a device measuring the colour temperature (and 'tint' or better even the spectral composition) of the incoming light. However since such a tool would have to be calibrated with the specific sensor characteristics AND the raw conversion software together, the practical implementation of such tools is pretty much limited to very specialized applications. I think to remember that some high-end Nikon cameras had such a tool, but maybe I am mixing up things here.

user-pic

WhiBal for the win! I never leave home without it.

Modern cameras ARE fairly impressive at getting exposure down for most scenes. I know most have a library of common scenes and choose the exposure based on that. Not nearly as possible with with white balance.

I shoot RAW only, so with a WhiBal all I might miss out on is a little bit of clipping - usually only in one channel - because the histogram is based on the AWB-produced JPEG. So, though AWB isn't exactly "right" all the time, it's not something I have to worry about much either.

user-pic

Can someone convince me why spending 30 bucks or more on a glorified grey card (WhiBal) affords superior results to a standard piece of white office paper, particularly when you're shooting RAW and planning to post-process anyway?

user-pic

@benK
You want a target that does not bend as the direction of the normal vector of the surface [you use as a target] relative to the direction of the vectors object-camera and object-light-source matters. (One can either align the normal vector of the target surface with the object-camera vector or take a position half-way between the object-camera and the object-light-source vector.)

You also want a matte surface and most importantly a target whose spectral reflectivity matches your subject (mainly, you don't want optical brighteners in your target).

user-pic

What you're trying to say in the first paragraph is that one needs a rigid, non-bendy card that faces square to the camera, right?

And in the second paragraph, you mean to say that one needs a card which is roughly as reflecty (or dull) as the subject?

user-pic

The whole series of posts on white balance has been very informative, and really well illustrated. My next favorite explanation of all this is Sean McHugh's series of workshops, although they get quite technical at times. Regarding this post, just a few thoughts:

1 - First, as both photos of the Moscone Center show, sometimes the correct white balance is not really the most pleasing version of the photo (I like the warmer version better). I guess it is better to talk about "neutral white balance" (which represents neutral grey as grey), rather than "correct" one, as this choice tends to depend on the eye of the belolder (well, the photographer, actually - I'm with El Aura's 'whatever pleases the eye' on this one). Often, a slight cast is really needed to convey the feel of the moment in a photograph (sunsets and such).

2 - I find WhiBal and similar neutral references very difficult / impractical to use in landscape photography (how do you put it 1/2 mile away?); and at close range too (e.g. flowers), as they so easily pick up reflected, local colors from objects (green from grass, red from flowers, etc.), making the whole "neutral, calibrated grey" issue beyond the point. So, my vote is for Expodisc/Expocap (cheaper), or similar such light-source-based methods. I actually use a white, semi-translucent lens cap, which came with my very old 1MP Sony Mavica, but it just happens to fit the lens size I use the most, and it works great. Why can't all camera manufacturers add these? They certainly would be more useful than my Nikon-branded lens caps which are only good for being lost...

user-pic

Leave a comment