Off Balance

In this article we confirm quantitatively that getting the White Point, hence the White Balance, right is essential to obtaining natural tones out of our captures.  How quickly do colors degrade if the estimated Correlated Color Temperature is off?

Fixed Transform, Different Illuminant

Recall from previous articles in this series that color differences are customarily measured by the CIE deltaE 2000 metric,[1] which is accessed through the XYZ color space.  Demosaiced raw data rgb is projected there by multiplication with white balance multipliers K_{rgb} and by compromise color matrix M:

(1)   \begin{equation*} XYZ \approx M * diag(K_{rgb}) * rgb \end{equation*}

with * indicating matrix multiplication and data in 3xN, column-vector format.  Together, K_{rgb} and M represent a color transform from rgb to XYZ.

Say for instance that the camera /converter (or you) thought that light at the scene had a Correlated Color Temperature (CCT) of 3000K and entered that into the relative White Balance section  – but in fact it was closer to 2800K.  Not knowing any better, the camera/converter would cue up a transform computed for the specified scene and illuminant type at 3000K.

The blue curve in the following simulation shows mean error[2]  in the BabelColor30 ColorChecker 24 ‘scene’ target under varying incandescent blackbody light sources, the CCT of which are shown on the x-axis.  Matrix M and K_{rgb} are computed for the CC24 under the chosen 3000K illuminant as captured by the sample Nikon D5100 we have been using in this series[3] – and kept constant throughout the plot.  At its best, the average residual color difference is 1.05 CIEDE2000 units when the White Point of the transform corresponds to that of light at the scene.

Figure 1. CIEDE2000 errors when the illuminant Type is correct, a blackbody radiator, but the Correlated Color Temperature used by the camera/converter is wrong.  The blue curve represents mean, the yellow standard deviation and the orange maximum error as measured off a BabelColor30’s ColorChecker 24 target, assuming capture by a Nikon D5100 with lens (the numbers refer to the offending patch).  Dots are errors in the White Point.

On the other hand, the mean error with 2800K light using the 3000K transform is 1.37 CIEDE2000.  The maximum error of any given patch, represented by the orange line, shoots quickly up, the overlaid numbers refer to the offending CC24 patch.  If we had the correct 2800K transform for the 2800K illuminant we would instead be back down to a mean just above 1 CIEDE2000.

Things are somewhat better further up in the temperature scale because changes are smaller on a percentage basis.  The following is for fixed white balance multipliers and matrix M developed for D53, with a residual error of 0.95 CIEDE2000 when the CCT of light at the scene is correctly identified:

Figure 2.  Residual CIEDE2000 error when the illuminant Type is correct, in this case a Standard Daylight Illuminant, but the Correlated Color Temperature used by the camera/converter is wrong.  The blue curve represents mean, the yellow standard deviation and the orange maximum error as measured off a BabelColor30’s ColorChecker 24 target, assuming capture by a Nikon D5100 with lens (the numbers refer to the offending patch).  Dots are errors in the White Point.

This of course assumes that the camera/converter/photographer were able to figure out and point the renderer to the correct scene, illuminant type and transform  for this CCT range.   We’ve seen in the previous article what happens when the wrong illuminant type is specified for instance.  Errors compound.

Interpolation Conundrum

In addition, cameras/converters don’t have pre-calculated transforms for every possible CCT.   Given a scene, the transform for the chosen illuminant is often calculated on the fly by interpolating between the two nearest available ones.

For instance, following Adobe’s workflow as outlined in the DNG spec,[4] the transform from white balanced raw data to XYZ is interpolated based on CCT in mired units (the inverse of CCT).   In DNG Converter files, the two provided extremes are usually smooth-curved illuminant A at 2856K at one end, and jagged D65 with a CCT around 6500K at the other, left below.

Figure 3. a) left: Spectral Power Distribution of Standard Illuminants A (blue line) and D65 (orange), the two ends of the interpolating range in most digital negative profiles.  b) right: Standard Illuminant D and black-body SPD, both at a CCT of 5300K.

Standard Daylight illuminants tend to follow the general shape of the closest blackbody radiator – but as you can see they are not that close at the extremities of the visible spectrum.  For instance if the extremes were both at a CCT of 5300K, like in Figure 3b above right, the interpolation between the curves would be an average of the two and less than ideal for both Daylight and blackbody sources at that temperature.

Color errors build up quickly with such deviations so it is better to interpolate between transforms of the same illuminant type and less apart in terms of CCT.  For example, for landscapes it would be best that the two extremes be based on illuminants of the Daylight ‘D’ type, say D45 to D65 or D50 to D60.  At lower temperatures the distance between the two should be proportionately smaller and vice versa.

This is what should happen in natural-color-conscious converters when one selects an illuminant type such as ‘Natural Daylight’: the more types available, the more relevant and accurate the transform pairs.  You should expect different transforms for every entry in the relative table, like those by Nikon and Sony in Figures 6 and 9 of the previous article for instance.  What say you, Adobe DNG?

A Natural Image Off Balance

As we have discovered, estimating the White Point and CCT correctly is essential for natural colors because it is how cameras and raw converters typically

  1. select the appropriate color transform pair for the given scene and illuminant type combination; and
  2. interpolate between them.

In this raw capture, Nikon’s camera and own raw converter NX Studio estimated CCT for Natural Light Auto at 4848K, while in fact it was 5850K.  Adobe Camera Raw said it was 4950K, RawTherapee 4765K and Capture One 4845K.  They were thrown way off by mountain topography, a slight cloud veil and patches of residual spring snow scattered around, as you can see below left.

The following images were all rendered by NX Studio: left is out-of-camera; the image in the center has the exact same settings as the previous one except that it was white balanced off a WhiBal gray card (not shown).

Image rendered with incorrect and correct white balance
Figure 4.  a) left: Out of camera image, Nikon NX Studio shows 4850K CCT. b) center; ‘Natural Light’ white balanced off a gray card. c) right: closest illuminant type ‘Shade’ selected, and CCT entered as measured by Color Meter at 5850K.

My color meter measured a CCT of 5850K at the scene, with 2.1 milliDuv, as expected for daylight lighting.   The closest preset in the light source menu of the White Balance section in NX Studio was ‘Cloudy’, which served up 6000K with zero Tint.[*]  Dialing that back to 5850K produced the image on the right.   I believe this last version is the one that makes best use of Nikon’s pre-computed color transforms for this camera and lighting.

In the central image, the correct white balance multipliers read off the gray card were able to help the converter estimate a more accurate White Point than it did in-camera – and therefore to compute a better transform, as described in the relative article.  The one to the right benefitted the most from actually knowing the White Point proper.

Note from Figure 2 that at these temperatures we don’t need to know the CCT of light at the scene with perfect accuracy: if we correctly identify the scene and illuminant type, -50K to +100K is plenty good as the increase in average color error is only around 1% when measured off the target in this example.  -180K to +300K is around 5%.  It goes up relatively more quickly from then on.  So for landscapes an estimated CCT within a hundred K or two should be good enough.

For an incandescent light source at 3000K that same range drops to -10K to +20K and -50K to +100K respectively.  The lower the temperature the more accurately CCT needs to be known and vice versa.

Note also that if these images weren’t shown side-by-side they wouldn’t look as different because we would quickly  adapt to them, at least partly.

Roll Your Own Transform

Since we are able to read the correct white balance multipliers K_{rgb} by capturing a gray card at the scene, isn’t there a way that we can also read parameters for transform M?  Not exactly because the resulting transform, whether linear or LUT, is always a compromise.  However, by properly capturing a relevant target in the same light as the scene we can estimate a more suitable transform for the given camera and lens as set up.  We did just that using a generic X-Rite ColorChecker 24 in the Forward Matrix article.

While we are at it we can capture one in the sun (say D53) as well as one in the shade (say D65), obtaining two relevant extremes for the same light source type, to be used in a custom ‘Spring Mountain Sun’ preset for example.  Repeat for different settings and applications.

The data necessary to create transforms out of such information is often packaged in a Profile file, of which there are two main formats in use: Digital Camera Profile (.dcp) and International Color Consortium (.icc).  Check if your raw converter is able to read them, camera proprietary ones often don’t – RawTherapee, ACR/LR and Capture One do.

A very nice piece of software that simplifies the process of creating a camera color Profile is Anders Torger’s polished Lumariver Profile Designer.  If you are comfortable with command line interfaces he also has a free open source version of it called DcamProf.  Its documentation is a treasure trove of information on the subject.[5] Alternatively, ArgyllCMS is another full-service command line open source suite that works well, though it can at first glance appear a bit overwhelming.[6]  Adobe has their own DNG Profile Editor which was last updated in 2012 and I personally find somewhat limiting.[4]

Choose Your Poison

For a given scene, transforms so obtained can be used as they are presuming the same illuminant type and White Point.  Deviations can be expected to produce errors similar to those shown in Figures 1 and 2.  If a dual illuminant profile was generated and selected, most software will interpolate between the two using estimated CCT in mired units, thus producing a better compromise color transform for the relative White Point.  It is up to you to make sure that the selected profile is suitable for the scene, illuminant type and CCT range in the capture it is being applied to.

The moral of the story is that getting the CCT / White Balance right in-camera and in-converter is a critical ingredient in obtaining a final image with natural colors – even when appropriate transform presets are available for the given scene and illuminant type.

This concludes the series of articles on the importance of white balance, which had its beginnings here.

 

Notes and References


1. The CIEDE2000 specification is a measure of color difference, with a value of one supposedly representing a just noticeable difference for a typical observer, you can find more about it here.
2. Color errors in this series of articles are CIEDE2000 differences from reference values for 19 color samples: the 18 color patches of the respective ColorChecker 24 target plus neutral patch 22.
3. “Reference data set for camera spectral sensitivity estimation, Maryam Mohammadzadeh Darrodi, Graham Finlayson, Teresa Goodman and Michal Mackiewicz, Vol. 32, No. 3 / March 2015 / J. Opt. Soc. Am. A”.  The relative data, the paper and additional information are available in this page.
4. Adobe’s Digital Negative DNG page is  here.
5. Lumariver Profile Designer can be found here and open source DcamProf’s  here.
6. ArgyllCMS Color Management System can be found here.
7. The Octave / Matlab routines used to produce the plots in this page can be downloaded by clicking here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.