Camera Image Quality

Color and Chroma Difference Algorithm

May 2023 Camera Image Quality Image Processing Color Science

Professional image quality analysis software such as Imatest and iQ-Analyzer provides objective, comprehensive, and consistent evaluations of camera image quality. In our practical experience, we have observed that different software employs varying algorithms for calculating the color difference. To enable efficient automated image analysis, we conducted extensive experimental studies to uncover the color difference algorithms employed by different software packages. This work discusses the advantages, disadvantages, and implementation details of the two algorithms.

1. Introduction

The ColorChecker® Patch Classic target is an array of 24 scientifically prepared natural, chromatic, primary and grayscale colored squares. These calibrated patches cover a broad spectrum of colors. When included in a test image, the ColorChecker serves as a reliable reference for comparing the captured output of cameras to the original chart’s accurate color measurements, ensuring precise color reproduction and consistency.

2. ColorChecker Application

  1. Provides a standard for camera calibration in color reproduction accuracy and auto white balance.
  2. Enables an accurate calculation of ΔE* and ΔC* to quantify the image color difference.
No. Color sRGB CIE L*a*b*
PatchSample RGB L*a*b*
1Dark Skin115826837.98613.55514.059
2Light Skin19415013065.71118.1317.81
3Blue Sky9812215749.927-4.88-21.925
4Foliage871086743.119-13.09521.905
5Blue Flower13312817755.1128.844-25.399
6Bluish Green10318917070.719-33.397-0.199
7Orange2141264462.66136.06757.096
8Purplish Blue809116640.0210.41-45.964
9Moderate Red193909951.12448.23916.248
10Purple946010830.32522.976-21.587
11Yellow Green1571886472.532-23.70957.255
12Orange Yellow2241634671.94119.36367.857
13Blue566115028.77814.179-50.297
14Green701487355.261-38.34231.37
15Red175546042.10153.37828.19
16Yellow2311993181.7334.03979.819
17Magenta1878614951.93549.986-14.574
18Cyan813316151.038-28.631-28.638
19White24324324296.539-0.4251.186
20Neutral 820020020081.257-0.638-0.335
21Neutral 6.516016016066.766-0.734-0.504
22Neutral 512212212150.867-0.153-0.27
23Neutral 3.585858535.656-0.421-1.231
24Black52525220.461-0.079-0.973

Table 1. CIELAB values under illuminant D50 for the ColorChecker® Classic.

3. Color & Chroma Difference

Calculating the color and chroma difference of images with the ColorChecker serves as a quantitative measure of a camera’s color reproduction accuracy.

The CIE Lab color space was designed to be approximately perceptually uniform and is widely used for calculating color differences. In the Lab color space, L*, a*, and b* represent lightness, the color on a green-red scale, and the color on a blue-yellow scale, respectively.

3.1 The CIE 1976 standard

The total color difference ΔE* is calculated by measuring the Euclidean distance between two Lab coordinates:

$$ ΔE_{ab}^* = \sqrt{(L_2^* - L_1^*)^2 + (a_2^* - a_1^*)^2 + (b_2^* - b_1^*)^2} $$

The conventional CIELAB chroma difference is the signed difference between two chroma coordinates:

$$ \Delta C_{ab}^*=C_{ab,2}^*-C_{ab,1}^* =\sqrt{a_2^{*2}+b_2^{*2}}-\sqrt{a_1^{*2}+b_1^{*2}} $$

Here, $C_{ab,i}^*=\sqrt{a_i^{*2}+b_i^{*2}}$. Color 1 denotes the reference and color 2 denotes the camera sample. Therefore, $\Delta C_{ab}^*<0$ indicates lower chroma than the reference, while $\Delta C_{ab}^*>0$ indicates higher chroma. Reversing the sample and reference reverses the sign.

Another useful quantity is the lightness-excluded chromatic-plane distance:

$$ D_{ab}=\sqrt{(\Delta a^*)^2+(\Delta b^*)^2} =\sqrt{(\Delta E_{ab}^*)^2-(\Delta L^*)^2} $$

$D_{ab}$ and $\Delta C_{ab}^*$ are not the same statistical object. The first is a non-negative Euclidean norm in the $a^*b^*$ plane; the second is a signed difference between radial chroma coordinates. Their exact relationship is

$$ (\Delta a^*)^2+(\Delta b^*)^2 =(\Delta C_{ab}^*)^2+(\Delta H_{ab}^*)^2, $$

$$ \Delta H_{ab}^*=2\sqrt{C_1^*C_2^*}\sin\left(\frac{\Delta h_{ab}}{2}\right). $$

Consequently, $|\Delta C_{ab}^*|\leq D_{ab}$. This distinction is more fundamental than simply describing the methods as rectangular versus polar coordinates: it is a comparison between a norm and a signed radial-coordinate difference.

3.2 The CIE 2000 standard

The formulas of ΔE* are revised to better address the perceptual non-uniformity problem. The CIEDE2000 standard introduced three major improvements in the color difference calculation:

  1. decomposing the difference into lightness, chroma, and hue-related components;
  2. adding location-dependent weighting factors to balance these components; and
  3. including a rotation term to account for the interaction between chroma and hue in the blue region.

The CIE LCh model is a cylindrical representation of Lab coordinates. In LCh, L*, C*, and h* represent lightness, chroma, and hue angle, respectively. Chroma is the radial distance from the neutral axis, and hue is computed with the four-quadrant angle $h=\operatorname{atan2}(b^*,a^*)$. CIE94, CMC, and CIEDE2000 specifically rely on this chroma-hue decomposition to apply perceptual weighting. The comprehensive calculation and boundary cases are described in the [CIEDE2000 implementation notes].

3.3 Industrial Color Difference Algorithm

The first step in calculating ΔE* and ΔC* involves converting the RGB color space to the Lab color space, which requires an intermediate transformation to the XYZ color space. As the source and target color spaces may have different reference white points, chromatic adaptation is necessary to ensure an accurate conversion.

Since the Lab reference white point of both Imatest and IQ-analyer is D50 and the RGB2XYZ transformation matrix is based on D65 illumination, the D50 chroma adaption needs to be applied in the calculation.

Denoted M1 as the RGB2XYZ transformation matrix and M2 as the Bradford matrix used for chroma adaption. The overall Lab conversion flowchart of Imatest and iQ-analyzer are shown below. $$ M_1 = \begin{bmatrix} 0.4124564 & 0.3575761 & 0.1804375 \\ 0.2126729 & 0.7151522 & 0.0721750 \\ 0.0193339 & 0.1191920 & 0.9503041 \end{bmatrix} $$

$$ M_2 = \begin{bmatrix} 1.0478112 & 0.0228866 & -0.050127 \\ 0.0295424 & 0.9904844 & -0.017049 \\ -0.009234 & 0.0150436 & 0.7521316 \end{bmatrix} $$

  1. Imatest: sRGB ➝ D65XYZ (M1) ➝ Lab
  2. iQ-analyzer: sRGB ➝ D65XYZ (M1)D50XYZ (M2) ➝ Lab

In our experiments, we revealed that Imatest and iQ-Analyzer report different statistical quantities under the same or similar ΔC label:

Imatest

Imatest uses an application-specific definition of ΔC: a lightness-excluded chromatic-plane distance rather than the conventional signed difference between two CIELAB chroma coordinates. Its CIE 1976 implementation is

$$ \Delta C_{ab,\mathrm{Imatest}}^*=\sqrt{(a_2^*-a_1^*)^2+(b_2^*-b_1^*)^2}. $$

For CIEDE2000, Imatest removes the lightness term but retains the chroma term, hue term, and their interaction:

$$ \Delta C_{00,\mathrm{Imatest}}^*= \sqrt{ \left(\frac{\Delta C’}{K_C S_C}\right)^2+ \left(\frac{\Delta H’}{K_H S_H}\right)^2+ R_T\left(\frac{\Delta C’}{K_C S_C}\right) \left(\frac{\Delta H’}{K_H S_H}\right) }. $$

Thus, the Imatest result is a non-negative magnitude that combines chroma and hue-related errors. Imatest itself notes that this ΔC definition differs from the pure chroma difference $\Delta|C^*|$.

iQ-Analyzer

The chroma difference calculated by iQ-Analyzer is the signed difference between two chroma coordinates:

$$ \Delta C_{ab,\mathrm{iQ}}^*= \sqrt{a_2^{*2}+b_2^{*2}}- \sqrt{a_1^{*2}+b_1^{*2}}. $$

Its CIEDE2000 output retains only the signed, perceptually weighted chroma component:

$$ \Delta C_{00,\mathrm{iQ}}^*= \frac{\Delta C’}{K_C S_C}. $$

The difference between chroma coordinates is the reason why the chroma difference calculated by iQ-Analyzer may have negative values. With the camera-minus-reference convention used here, a negative value indicates undersaturation and a positive value indicates oversaturation. This direction is directly actionable for saturation gain and 3D-LUT tuning, whereas a norm cannot provide it.

The difference remains important in CIEDE2000. If

$$ x=\frac{\Delta C’}{K_C S_C},\qquad y=\frac{\Delta H’}{K_H S_H}, $$

then iQ-Analyzer reports $x$, while Imatest reports $\sqrt{x^2+y^2+R_Txy}$. Unlike the CIE 1976 case, the Imatest magnitude is not guaranteed to be greater than $|x|$. Around the CIEDE2000 blue-region rotation zone ($\bar h’\approx275^\circ$), $R_T$ can be negative, so the interaction term may reduce the combined result. For example, $R_T=-1.73$ and $y=0.866x$ give

$$ \sqrt{x^2+0.75x^2-1.498x^2}\approx0.50|x|. $$

Therefore, cross-tool comparisons may produce counterintuitive results for some blue color pairs. The exact behavior should be verified using the measured Lab values rather than inferred from the patch name alone.

4. Advantages of the Signed Chroma Difference

  1. Actionable direction. A negative value indicates lower chroma and a positive value indicates higher chroma, provided that sample minus reference is used. This maps naturally to the direction of saturation-gain or 3D-LUT adjustment.
  2. Interpretable attributes. Chroma and hue describe errors in terms such as too vivid, too weak, or hue-shifted more directly than raw $a^*$ and $b^*$ coordinate changes.
  3. Compatibility with perceptual decomposition. CIE94, CMC, and CIEDE2000 explicitly separate lightness, chroma, and hue-related components and apply location-dependent weighting.
  4. Systematic-bias analysis. The mean of signed values can expose a global bias, while standard deviation or RMS describes spread. If all 24 patches have $\Delta C=+5$, the signed mean is $+5$ and immediately reveals global oversaturation. If half are $+5$ and half are $-5$, the mean is 0 but the RMS is 5, indicating heterogeneous patch-dependent errors that require further analysis against reference hue.
  5. Useful diagnostic cues. Large chroma and hue components can guide the inspection of saturation/gamut processing versus CCM, spectral mismatch, or white balance. This is a diagnostic heuristic rather than a unique identification of the responsible ISP module.

5. Limitations of the Signed Chroma Difference

Hue blind spot

A pure hue rotation can have $\Delta C=0$. For example, $(a_1^*,b_1^*)=(20,0)$ and $(a_2^*,b_2^*)=(0,20)$ have equal chroma, so $\Delta C_{ab}^*=0$, even though

$$ \sqrt{(\Delta a^*)^2+(\Delta b^*)^2} =\Delta H_{ab}^*\approx28.3. $$

Reporting signed ΔC alone would therefore miss a severe hue error.

Neutral-axis instability

As $C^*\rightarrow0$, hue becomes undefined and $\partial h/\partial(a,b)$ grows approximately as $1/C$. The hue angles of neutral ColorChecker patches can therefore be dominated by measurement noise. The chroma coordinate remains defined, but hue and signed $\Delta H$ require special handling near the neutral axis.

Magnitude bias under noise

Under a first-order model where $a^*$ and $b^*$ contain independent, isotropic, zero-mean Gaussian noise with standard deviation $\sigma$, the measured chroma magnitude follows a Rice distribution. Its expectation is approximately

$$ E[\hat C]\approx C_{\mathrm{true}}+\frac{\sigma^2}{2C_{\mathrm{true}}} \quad(C_{\mathrm{true}}\gg\sigma), $$

and approaches

$$ E[\hat C]\rightarrow\sigma\sqrt{\frac{\pi}{2}} \quad(C_{\mathrm{true}}\rightarrow0). $$

Noisy measurements therefore tend to overestimate chroma, especially for low-chroma patches. In high-ISO images this may partially cancel true undersaturation or create a false positive ΔC for neutral patches. This model is conditional: noise after the nonlinear RGB-to-Lab conversion may be correlated, heteroscedastic, or non-Gaussian and should be validated experimentally.

6. Advantages and Limitations of the Chromatic-Plane Norm

The CIE 1976 chromatic-plane norm $D_{ab}$ is well-defined everywhere, contains no hue-angle singularity, and is a true Euclidean metric in the $a^*b^*$ plane. Under an additive zero-mean Lab-domain noise model, the individual $\Delta a^*$ and $\Delta b^*$ components are linear and easier to propagate. The norm also has no chromatic blind spot: it is zero only when both $a^*$ and $b^*$ match. These properties make it useful as a single-number chromatic pass/fail measure, although full color conformance should use ΔE when lightness error is also important.

Its disadvantages are equally important. A non-negative norm loses the direction of the chroma bias and cannot separate chroma and hue-related contributions. An unweighted Euclidean norm also does not include the location-dependent perceptual corrections used by CIE94, CMC, or CIEDE2000. Moreover, CIELAB is only approximately perceptually uniform, with known non-uniform behavior for saturated colors and in the blue-violet region.

Reference

  1. ColorChecker reference table: https://xritephoto.com/documents/literature/en/ColorData-1p_EN.pdf
  2. Imatest Color/Tone Appendix: https://www.imatest.com/docs/colortone_ref/
  3. iQ-analyzer ColorChecker application: https://www.image-engineering.de/news/product-news/773-the-iq-analyzer-color-bundle
  4. The CIEDE2000 Color-Difference Formula: Implementation Notes, Supplementary Test Data, and Mathematical Observations: https://www.ece.rochester.edu/~gsharma/ciede2000/ciede2000noteCRNA.pdf
  5. ISO/CIE 11664-6:2022, Colorimetry—Part 6: CIEDE2000 Colour-Difference Formula: https://www.cie.co.at/publications/colorimetry-part-6-ciede2000-colour-difference-formula-1