Algorithms and reference formulas
This page contains algorithms and reference formulas for Colorcheck, ColorTest, and
Multicharts. It’s all in green text because it’s all math.
Color difference (error) formulas
The notation on this page is adapted from the Digital Color Imaging Handbook, edited
by Gaurav Sharma, published by the CRC Press, referred to below as DCIH. The DCIH
online Errata was consulted.
In measuring color error, keep it in mind that accurate color is not necessarily the same
as pleasing color. Many manufacturers deliberately alter colors to make them more
pleasing, most often by increasing saturation. (That is why Fujichrome Velvia was so
successful when it was introduced in the 1990.) In calculating color error, you may
choose not to use the exact ColorChecker (or other chart) L*a*b* reference values; you
may want to substitute your own enhanced values. Imatest Master allows you to enter
values from a file written in CSV format (you can save the values from a measured chart
using Multicharts).
Imatest users frequently ask about the meaning of “corr” and “uncorr” in the Colorchedk
a*b* error plot. Corr means that the mean saturation (mean chroma; mean(sqrt(a*2+b*2))
of the camera is adjusted to be the same as that of the reference before making the
comparison. This is a very easy correction to make; it tells how accurate the color could
be if the mean chroma were the same as the reference. See below for more detail.
Absolute differences (including luminance)
CIE 1976
The L*a*b* color space was designed to be relatively perceptually uniform. That means
that perceptible color difference is approximately equal to the Euclidean distance
between L*a*b* values. For colors {L1*, a1*, b1*} and {L2*, a2*, b2*}, where ∆L* = L2* –
L1*, ∆a* = a2* – a1*, and ∆b* = b2* – b1*,
∆E*ab = ( ( ∆L*)2 + (∆a*)2 + (∆b*)2 )
(…) ).
1/2 (DCIH (1.42, 5.35); (…)
1/2 denotes square root of
Although ∆E*ab is relatively simple to calculate and understand, it’s not very accurate
expecially for strongly saturated colors. L*a*b* is not as perceptually uniform as its
designers intended. For example, for saturated colors, which have large chroma values
(C* = ( a*2 + b*2 )1/2 ), the eye is less sensitive to changes in chroma than to
corresponding changes for Hue (∆H* = ( (∆E*ab)2 – (∆L*)2 – (∆C*)2 )
1/2 ) or Luminance
(∆L*). To address this issue, several additional color difference formulas have been
established. In these formulas, just-noticeable differences (JNDs) are represented by
ellipsoids rather than circles.
CIE 1994
The CIE-94 color difference formula, ∆E*94, provides a better measure of perceived
color difference than ∆E*ab .
∆E*94 = ( (∆L*)2 + (∆C* ⁄ SC )2 + (∆H* ⁄ SH )2 )
where
1/2 (DCIH (5.37); omitting constants set to 1 ),
SC = 1 + 0.045 C* ; SH = 1 + 0.015 C* (DCIH (1.53, 1.54) )
[ C* = ( ( a1*2 + b1*2 )1/2 ( a2*2 + b2*2 )1/2 )1/2 (the geometrical mean chroma) gives
symmetrical results for colors 1 and 2. However, when one of the colors (denoted by
subscript s) is the standard, the chroma of the standard, Cs* = ( as*2 + bs*2 )1/2, is
preferred for calculating SC and SH. The asymmetrical equation is used by Bruce
Lindbloom.]
∆H* = ( (∆E*ab)2 – (∆L*)2 – (∆C*)2 )
1/2 (hue difference ; DCIH (5.36) )
∆C* = ( a1*2 + b1*2 )
1/2 – ( a2*2 + b2*2 )
1/2 (chroma difference)
An early meeting of the CMC Standards
Committee
CMC
The CMC color difference formula is widely
used by the textile industry to match bolts of
cloth. Although it’s less familiar to
photographers than the CIE 1976 geometric
distance ∆E*ab , it was one of the best
measurement metrics prior to CIEDE2000.
But it never gained traction in the
photographic industry. It is slightly
asymmetrical: subscript s denotes the
standard (reference) measurement. CMC is
the Color Measurement Committee of the
Society of Dyers and Colourists (UK).
∆E*CMC(l,c) = ( (∆L* ⁄ lSL)2 + (∆C* ⁄ cSC )2 + (∆H* ⁄ SH )2 )
1/2 (DCIH (5.37) ), where
(That’s the lowercase letter l in (l,c) and the denominator of (∆L* ⁄ lSL)2.) ∆E*CMC(1,1) (l =
c = 1) is used for graphic arts perceptibility mesurements. l = 2 is used in the textile
industry for acceptibility of fabric matching. For now Imatest displays ∆E*CMC(1,1).
SL = 0.040975 Ls* ⁄ (1+0.01765 Ls*) ; Ls* ≥ 16 (DCIH (1.48) )
= 0.511 ; Ls* < 16
SC = 0.0638 Cs* ⁄ (1+0.0131 ) + 0.638 ; SH = SC (TCMC FCMC + 1 – FCMC ) (DCIH (1.49,
1.50) )
FCMC = ( ( Cs*)4 ⁄ ( ( Cs*)4 + 1900 ) )1/2 (DCIH (1.51);
TCMC = 0.56 + | 0.2 cos(hs* + 168°) | 164° ≤ hs* ≤ 345° (DCIH (1.52) )
= 0.36 + | 0.4 cos(hs* + 35 °) | otherwise
∆H* and ∆C* have the same formulas as CIE-94.
CIEDE2000
The CIEDE2000 formulas (∆Eoo and ∆Coo ) are the upcoming standard, and may be
regarded as more accurate than the previous formulas. We omit the equations here
because they are described very well on Gaurav Sharma’s CIEDE2000 Color-
Difference Formula web page. Default values of 1 are used for parameters kL, kC, and
kH.
At the time of this writing (February 2008) the CIE 1976 color difference metrics
(∆E*ab…) are still the most familiar. CIE 1994 is more accurate and robust, and retains a
relatively simple equation. ∆E*CMC is more complex but widely used in the textile
industry. The complexity of the CIEDE2000 equations (DCIH, section 1.7.4, pp. 34-40)
has slowed their widespread adoption, but they are on their way to becoming the
accepted standard. For the long run, CIEDE2000 color difference metrics are the
best choice.
Color differences that omit luminance difference
Since Colorcheck measures captured images, exposure errors will strongly affect color
differences ∆E*ab, ∆E*94, and ∆E*00. Since it is useful to look at color errors
independently of exposure error, we define color differences that omit ∆L*.
∆Cab = ((∆a*)2 + (∆b*)2 )1/2
= ((∆E*ab)2 – (∆L*)2 )1/2 (This is a more general form: Delta-E with Delta-L removed.)
∆C94 = ( (∆C* ⁄ SC )2 + (∆H* ⁄ SH )2 )1/2
∆CCMC = ((∆C* ⁄ SC )2 + (∆H* ⁄ SH )2 )
1/2
∆C00 omits the ( ∆L’ ⁄ kLSL )2 term from the ∆E00 (square root) equation (see Sharma).
These formulas don’t entirely remove the effects of exposure error since a* and b* are
affected somewhat by exposure, but they reduce it to a manageable level. Note that the
∆C definition can cause some confusion because it is different from the pure chroma
difference, ∆C*, where chroma = C* = sqrt(a*2 + b*2). ∆C* is not suitable as a
perceptual measurement because it does not include hue.
Notation changes (made for consistency with textbooks such as DCIH)
∆Cab =1 ⁄ max(R,G,B). S correlates more closely with perceptual White Balance error in HSV
representation than it does in HSL.
The equation for saturation boost in the lower image of the third figure is S’ = (1-e-4S ) ⁄ (1-e-4), where e =
2.71828…
Grayscale levels and exposure error
The Colorchecker grayscale patch densities (in the bottom row) are specified as 0.05, 0.23, 0.44, 0.70,
1.05, and 1.50. Using the equation, pixel level = 255 * (10–density ⁄ 1.06)
(1/2.2) (see ISO speed, below), the
ideal pixel levels would be 236, 195, 157, 119, 83, and 52, about 3% lower than the values measured by
Bruce Lindbloom (242, 201, 161, 122, 83, and 49 for the Green channel) and provided with a
Colorchecker purchased in October 2005 (243, 200, 160, 122, 85, 52). On the average, these measured
values fit the equation,
pixel level = 255 * (10–density ⁄ 1.01)
(1/2.2)
Exposure error is measured by comparing the measured levels of patches 2-5 in the bottom row (20-23 in
the chart as a whole) with the selected reference levels. Patches 1 and 6 (19, 24) are omitted because
they frequently clip. Since pixel level is proportional to exposuregamma, and hence log10(exposure) is
proportional to log10(pixel level) ⁄ gamma (where gamma is measured from patches 2-5), the log exposure
error for an individual patch is
∆(log exposure) = (log10(measured pixel level) – log10(reference level)) ⁄ gamma
Using the mean value of ∆(log exposure) for patches 2-5 and the equation, f-stops = 3.32 * log exposure,
Exposure error in f-stops = 3 32 * (mean(log10(measured pixel level) – log10(reference level))) ⁄ gamma
ISO sensitivity
Starting with Imatest Master 3.5, two types of ISO sensitivity are calculated: Satuaraton-based Sensitivity
and Standard Output Sensitivity. These measurements are described on the ISO Sensitivity page.
1. ∆a*)2 + (∆b*)2 )1/2
1.
, formerly called ∆E(a*b*), is the color difference (only), with L* omitted.
1. ∆E*ab = ( ( ∆L*)2 + (∆a*)2 + (∆b*)2 )1/2, formerly called ∆E(L*a*b*), is the total difference, including
L*.
This notation is somewhat confusing because ∆E*ab includes L* (as well as a and b) in its
formula.
Color differences corrected for chroma (saturation) boost/cut
Many digital cameras deliberately boost chroma, i.e., saturation, to enhance image
appearance in digital cameras. This boost increases color error in the ∆E* and ∆C
formulas, above.
The mean chroma percentage is
Chrp = 100% * (measured mean( (ai*2+bi*2)1/2 ) ) ⁄ (Colorchecker mean( (ai*2+bi*2)1/2 ) )
= 100% * mean (Cmeasured) ⁄ mean (Cideal) ; Ci = (ai*2+bi*2 )1/2
1 ≤ i ≤ 18 (the first three rows of the Colorchecker)
Chroma, which is closely related to the perception of saturation, is boosted when Chrp >
100. Chroma boost increases color error measurements ∆E*ab, ∆C*ab, ∆E*94, and ∆C*94.
Since it is easy to remove chroma boost in image editors (with saturation settings), it is
useful to measure the color error after the mean chroma has been corrected
(normalized) to 100%. To do so, normalized ai_corr and bi_corr are substituted for
measured (camera) values ai and bi in the above equations.
ai_corr = 100 ai ⁄ Chrp ; bi_corr = 100 bi ⁄ Chrp
The reference values for the ColorChecker are unchanged. Color differences corrected
for chroma are denoted ∆C*ab(corr), ∆C*94(corr), and ∆C*CMC(corr).
Mean and RMS values
Colorcheck Figure 3 reports the mean and RMS values of ∆C*ab corrected (for
saturation) and uncorrected, where
mean(x) = Σxi ⁄ n for n values of x.
RMS(x) = σ(x) = (Σxi
2 ⁄ n )1/2 for n values of x.
The RMS value is of interest because it gives more weight to the larger errors.
Algorithm
•
Locate the regions of interest (ROIs) for the 24 ColorChecker zones.
• Calculate statistics for the six grayscale patches in the bottom row, including the average pixel levels and a second order
polynomial fit to the pixel levels in the ROIs— this fit is subtracted from the pixel levels for calculating noise. It removes
the effects of nonuniform illumination. Calculate the noise for each patch.
• Using the average pixel values of grayscale zones 2-5 in the bottom (omitting the extremes: white and black), the average
pixel response is fit to a mathematical function (actually, two functions). This requires some explanation.
A simplified equation for a capture device (camera or scanner) response is,
normalized pixel level = (pixel level ⁄ 255) = k1 exposuregamc
Gamc is the gamma of the capture device. Monitors also have gamma = gamm defined
by
monitor luminance = (pixel level ⁄ 255)gamm
Both gammas affect the final image contrast,
System gamma = gamc * gamm
Gamc is typically around 0.5 = 1/2 for digital cameras. Gamm is 1.8 for Macintosh
systems; gamm is 2.2 for Windows systems and several well known color spaces
(sRGB, Adobe RGB 1998, etc.). Images tend to look best when system gamma is
somewhat larger than 1.0, though this doesn’t always hold— certainly not for contrasty
scenes. For more on gamma, see Glossary, Using Imatest SFR, and Monitor calibration.
Using the equation, density = – log10(exposure) + k,
log10(normalized pixel level) = log10( k1 exposuregamc ) = k2 – gamc * density
This is a nice first order equation with slope gamc, represented by the blue dashed
curves in the figure. But it’s not very accurate. A second order equation works much
better:
log10(normalized pixel level) = k3 + k4 * density + k5 * density2
k3, k4, and k5 are found using second order regression and plotted in the green dashed
curves. The second order fit works extremely well.
• Saturation S in HSV color representation is defined as S(HSV) = (max(R,G,B)-min(R,G,B [↩]