White light is a combination of all the visible colors; normally this is from the midday sun in a clear sky. There are atmospheric conditions that block some colors more than others, producing a different color daylight. Clouds and shadows produce a bluer light while early morning and late afternoon sunlight has a more yellow tinge. However, our eyes and brain compensate for color temperature variations and we have no trouble recognizing basic colors under most lighting conditions.
The color temperature scale shows variation in the overall color of light in degrees Kelvin. Similarly artificial light sources produce light with a characteristic color cast. Here is an approximation of where various light sources sit on the Kelvin scale, from a low or red value to the high or blue end:
With film, there were two choices, use a special film for each light condition or use a filter to block the predominant color cast. Digital cameras offer greater flexibility and convenience as the camera can automatically measure the color temperature and or the white balance of the image for use as a reference in normal digital image processing.
Most digital cameras offer the photographer a choice of common preset white balance values as an option to the automatic system. More advanced cameras allow the white balance to be set manually, usually by taking a photo of a white or gray reference object.
The digital camera processes the image based on the current white balance value and then saves it as a jpeg file. Generally, this process is effective and digital cameras produce acceptable images under a wide range of different lighting conditions, with little or no intervention from the photographer. There are situations where the exact color is important or the lighting is a complex mix of sources.
For example, an indoor shot with sunlight dominating lighting in half the shot while electric lamps light the other part. There may be a tendency for the digital camera's automatic system to average the different color temperatures over the whole image and decide on a white balance somewhere between sunlight and the electric lamps. Another difficult situation is where there is a large area with a strong dominant color in the shot which may fool the digital camera resulting in an incorrect AWB, a red object may fool it into thinking the scene is too warm and try to cool it off with a bluer color temperature, giving washed out reds.
These complex photographic situations are where advanced cameras with the capability of saving images as RAW image data come into their own. They allow the photographer to delay setting the white balance until they view the image on their computer and experiment with different white balance values.
Not only is this useful for producing correct colors, it is also a valuable creative tool. Varying the color temperature for the a RAW image can produce a warm and cozy feeling for a yellow or candle light look, or give a crisp and clear whiter appearance with a bluer cast.
Here are three shots from an indoor exhibition. The first uses only venue lighting and has noticeable yellowish cast and the camera measured the color temperature as 3550K. The next is a mixture of fill in flash and artificial light and the color temperature is 4900K. The second shot is whiter and crisper than the first. The third shot is a wider shot using only venue lighting, however, the camera measured the color temperature as 4200K, showing that color temperature can vary with the same lighting depending on the shot.