How do white balance modes work inside a digital camera?

Asked 3/18/2014

3 views

2 answers

0

On a Nikon D7100 or similar DSLR, what does the camera actually do when I choose a white balance mode such as Auto, a preset, Kelvin, or Custom? Does white balance change the sensor’s color sensitivity, or is it applied later in processing? Also, how does Auto White Balance decide what setting to use?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

12y ago

2 Answers

16

The camera can not alter the spectral sensitivities of the sensor, those are baked into the chip.

What actually happens depends on what format your saving files in. If it's a Raw file format, what happens is the cameras white balance setting is recorded in the raw file for a raw file processor to use to create that white balance.

If you're writing JPEG files it's a bit different. The camera knows the color sensitivities of the sensor, and armed with that information can calculate how much change is needed to each pixel and in what direction depending on the white balance chosen in the camera.

Bear in mind that none of this math is done in RGB values but prior to that calculation using the CIEXYZ color space. Then depending on the ICC profile container space chosen in the camera the XYZ values for each pixel are calculated with the new white point. So the XYZ values for the same color could result in different RGB values depending on the choice of Adobe RGB or sRGB.

Other calculations are done to remove sensor noise (dark frame subtraction) and the change to the white point occurs after lots of color rendering algorithms are run to change the linear RGB values to scene referred RGB, then to output referred as they are written to the correct color space.

Auto White balance looks at the predominant color in the brightest areas of the scene and uses that as the basis for what white must be. Much like our visual system uses chromatic adaptation, but in a much more simple way. There is a section of XYZ color space called the spectral locus. See below Spectral Locus

So the white point is adjusted along this known line based on what the sensor picks up as the strongest white value. In many images there is no clear white point so the camera uses this line to decide where to place its white point by what part of the spectral locus is closest to the brightest pixels.

Originally by user21926. Source · Licensed CC BY-SA 4.0

user21926

12y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

White balance does not change the sensor’s spectral sensitivity or the way the sensor captures light. Those characteristics are fixed in the sensor.

What changes is the color processing applied to the captured data:

  • RAW: the sensor data is recorded essentially the same regardless of WB setting. The camera stores the selected white balance as metadata (and usually applies it to the embedded JPEG preview/thumbnail).
  • JPEG: the camera applies a color transform/gain to the captured data during image processing, effectively boosting or reducing color channels to make neutral subjects look neutral under the chosen light.

White balance modes are typically:

  • Auto WB: the camera analyzes the scene at multiple points and estimates the illumination color temperature/tint using an internal algorithm.
  • Preset/Kelvin: the camera uses predefined or user-entered color temperature values.
  • Custom: the camera measures light reflected from a neutral/white target and calculates the needed correction.

So internally, WB is best thought of as color-channel multipliers/color transforms applied after capture, not a change to sensor sensitivity. That’s why WB is far more flexible to adjust later when shooting RAW than when shooting JPEG.

UniqueBot

AI

12y ago

Your Answer