Color difference

Uses your system voice; voice and rate in settings.

Snapshot

≈ 13 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

In color science, color difference or color distance is the separation between two colors. This metric allows quantified examination of a notion that formerly could only be described with adjectives. Quantification of these properties is of great importance to those whose work is color-critical. Common definitions make use of the Euclidean distance in a device-independent color space.

In color science, color difference or color distance is the separation between two colors. This metric allows quantified examination of a notion that formerly could only be described with adjectives. Quantification of these properties is of great importance to those whose work is color-critical. Common definitions make use of the Euclidean distance in a device-independent color space.

Euclidean

\text{distance} = \sqrt{(R_2 - R_1)^2 + (G_2 - G_1)^2 + (B_2 - B_1)^2}. When the result should be computationally simple as well, it is often acceptable to remove the square root and simply use \text{distance}^2 = (R_2 - R_1)^2 + (G_2 - G_1)^2 + (B_2 - B_1)^2. This will work in cases when a single color is to be compared to a single color and the need is to simply know whether a distance is greater. If these squared color distances are summed, such a metric effectively becomes the variance of the color distances. There have been many attempts to weigh RGB values, however these are demonstrably worse at color determinations and are properly the contributions to the brightness of these colors, rather than to the degree to which human vision has less tolerance for these colors. The closer approximations would be more properly (for non-linear sRGB, using a color range of 0–255): \begin{cases} \sqrt{2 \Delta R^2 + 4 \Delta G^2 + 3 \Delta B^2}, & \bar R where: \begin{aligned} \Delta R &= R_1 - R_2, \\ \Delta G &= G_1 - G_2, \\ \Delta B &= B_1 - B_2, \\ \bar R &= \frac12 (R_1 + R_2). \end{aligned} One of the better low-cost approximations, sometimes called "redmean", combines the two cases smoothly: \begin{aligned} \bar r &= \frac12 (R_1 + R_2), \\ \Delta C &= \sqrt{\left(2 + \frac{\bar r}{256}\right) \Delta R^2 + 4 \Delta G^2 + \left(2 + \frac{255 - \bar r}{256}\right) \Delta B^2}. \end{aligned} ( ) There are a number of color distance formulae that attempt to use color spaces like HSV or HSL with the hue represented as a circle, placing the various colors within a three-dimensional space of either a cylinder or cone, but most of these are just modifications of RGB; without accounting for differences in human color perception, they will tend to be on par with a simple Euclidean metric. \Delta E_\text{ITP} = 720 \sqrt{(I_1 - I_2)^2 + (T_1 - T_2)^2 + (P_1 - P_2)^2}, where the components of this "ITP" is given by I = I, T = 0.5 C T , P = C P . The Euclidean measure is known to work poorly on large color distances (i.e. more than 10 units in most systems). On CIELAB, a hybrid approach where a taxicab distance is used between the lightness and the chroma plane, \Delta E_{\text{HyAB}} = \sqrt{ (a_2-a_1)^2+(b_2-b_1)^2 } + \left| L_2-L_1 \right| , is shown to work better than Euclidean and CIEDE2000.

CIELAB ΔE*

The International Commission on Illumination (CIE) calls their distance metric (also inaccurately called , , or "Delta E") where delta is a Greek letter often used to denote difference, and E stands for Empfindung; German for "sensation". Use of this term can be traced back to Hermann von Helmholtz and Ewald Hering. Perceptual non-uniformities in the underlying CIELAB color space have led to the CIE refining their definition over the years, leading to the superior (as recommended by the CIE) 1994 and 2000 formulas. These non-uniformities are important because the human eye is more sensitive to certain colors than others. CIELAB metric is used to define color tolerance of CMYK solids. A good metric should take this into account in order for the notion of a "just noticeable difference" (JND) to have meaning. Otherwise, a certain may be insignificant between two colors in one part of the color space while being significant in some other part. All formulae are originally designed to have the difference of 1.0 stand for a JND. This convention is generally followed by other perceptual distance functions such as the aforementioned . However, further experimentation may invalidate this design assumption, the revision of CIE76 JND to 2.3 being an example.

CIE76

The CIE 1976 color difference formula is the first formula that related a measured color difference to a known set of CIELAB coordinates. This formula has been succeeded by the 1994 and 2000 formulas because the CIELAB space turned out to be not as perceptually uniform as intended, especially in the saturated regions. This means that this formula rates these colors too highly as opposed to other colors. Given two colors in CIELAB color space, ({L^*_1},{a^*_1},{b^*_1}) and ({L^*_2},{a^*_2},{b^*_2}) , the CIE76 color difference formula is defined as: \Delta E_{ab}^* = \sqrt{ (L^*_2-L^*_1)^2+(a^*_2-a^*_1)^2 + (b^*_2-b^*_1)^2 }. \Delta E_{ab}^* \approx 2.3 corresponds to a JND (just noticeable difference).

CMC l:c (1984)

In 1984, the Colour Measurement Committee of the Society of Dyers and Colourists defined a difference measure based on the CIE L*C*h color model, an alternative representation of L*a*b* coordinates. Named after the developing committee, their metric is called CMC l:c. The quasimetric (i.e. it violates symmetry: parameter T is based on the hue of the reference h_1 alone) has two parameters: lightness (l) and chroma (c), allowing the users to weight the difference based on the ratio of l:c that is deemed appropriate for the application. Commonly used values are 2:1 for acceptability and 1:1 for the threshold of imperceptibility. The distance of a color (L^*_2,C^*_2,h_2) to a reference (L^*_1,C^*_1,h_1) is: \Delta E^*_{CMC} = \sqrt{ \left( \frac{L^*_2-L^*_1}{l \times S_L} \right)^2 + \left( \frac{C^*_2-C^*_1}{c \times S_C} \right)^2 + \left( \frac{\Delta H^*_{ab}}{S_H} \right)^2 } S_L=\begin{cases} 0.511 & L^*_1 F = \sqrt{\frac{C^{*^4}_1}{C^{*^4}_1+1900}} \quad T=\begin{cases} 0.56 + |0.2 \cos (h_1+168^\circ)| & 164^\circ \leq h_1 \leq 345^\circ \\ 0.36 + |0.4 \cos (h_1+35^\circ) | & \mbox{otherwise} \end{cases} CMC l:c is designed to be used with D65 and the CIE Supplementary Observer.

CIE94

The CIE 1976 color difference definition was extended to address perceptual non-uniformities, while retaining the CIELAB color space, by the introduction of application-specific parametric weighting factors k L , k C and k H , and functions S L , S C , and S H derived from an automotive paint test's tolerance data. As with the CMC I:c, ΔE (1994) is defined in the L*C*h* color space and likewise violates symmetry, therefore defining a quasimetric. Given a reference color{{efn|1=Called such because the operator is not commutative. This makes it a quasimetric. Specifically, S_{\{C,H\}} both depend on C^*_1 only.}} (L^*_1, a^*_1, b^*_1) and another color (L^*_2, a^*_2, b^*_2) , the difference is \Delta E_{94}^* = \sqrt{\left(\frac{\Delta L^*}{k_L S_L}\right)^2 + \left(\frac{\Delta C^*}{k_C S_C}\right)^2 + \left(\frac{\Delta H^*}{k_H S_H}\right)^2}, where \begin{aligned} \Delta L^* &= L^*_1 - L^*_2, \\ C^*_1 &= \sqrt{{a^*_1}^2 + {b^*_1}^2}, \\ C^*_2 &= \sqrt{{a^*_2}^2 + {b^*_2}^2}, \\ \Delta C^* &= C^*_1 - C^*_2, \\ \Delta H^* &= \sqrt{{\Delta E^*_{ab}}^2 - {\Delta L^*}^2 - {\Delta C^*}^2} = \sqrt{{\Delta a^*}^2 + {\Delta b^*}^2 - {\Delta C^*}^2}, \\ \Delta a^* &= a^*_1 - a^*_2, \\ \Delta b^* &= b^*_1 - b^*_2, \\ S_L &= 1, \\ S_C &= 1 + K_1 C^*_1, \\ S_H &= 1 + K_2 C^*_1, \\ \end{aligned} and where k C and k H are usually both set to unity, and the parametric weighting factors k L , K 1 and K 2 depend on the application: Geometrically, the quantity \Delta H^*_{ab} corresponds to the arithmetic mean of the chord lengths of the equal chroma circles of the two colors.

CIEDE2000

Since the 1994 definition did not adequately resolve the perceptual uniformity issue, the CIE refined their definition with the CIEDE2000 formula published in 20011, adding five corrections: A hue rotation term (R T ), to deal with the problematic blue region (hue angles in the neighborhood of 275°): Compensation for neutral colors (the primed values in the L*C*h differences) Compensation for lightness (S L ) Compensation for chroma (S C ) Compensation for hue (S H ) \Delta E_{00}^* = \sqrt{ \left(\frac{\Delta L'}{k_L S_L}\right)^2 + \left(\frac{\Delta C'}{k_C S_C}\right)^2 + \left(\frac{\Delta H'}{k_H S_H}\right)^2 + R_T \frac{\Delta C'}{k_C S_C}\frac{\Delta H'}{k_H S_H} } The formulae below should use degrees rather than radians; the issue is significant for R T . The parametric weighting factors k L , k C , and k H are usually set to unity. \Delta L^\prime = L^*_2 - L^*_1 \bar{L} = \frac{L^*_1 + L^*_2}{2} \quad \bar{C} = \frac{C^*_1 + C^*_2}{2} \quad \mbox{where } C^*_1 = \sqrt{{a^*_1}^2 + {b^*_1}^2}, \quad C^*_2 = \sqrt{{a^*_2}^2 + {b^*_2}^2}, \quad a_1^\prime = a_1^* + \frac{a_1^*}{2} \left( 1 - \sqrt{\frac{\bar{C}^7}{\bar{C}^7 + 25^7}} \right) \quad a_2^\prime = a_2^* + \frac{a_2^*}{2} \left( 1 - \sqrt{\frac{\bar{C}^7}{\bar{C}^7 + 25^7}} \right) \bar{C}^\prime = \frac{C_1^\prime + C_2^\prime}{2} \mbox{ and } \Delta{C'}=C'_2-C'_1 \quad \mbox{where } C_1^\prime = \sqrt{a_1^{'^2} + b_1^{*^2}} \quad C_2^\prime = \sqrt{a_2^{'^2} + b_2^{*^2}} \quad h_1^\prime = \begin{cases} 0 & b_1^* = 0, a_1^\prime = 0 \\ \text{atan2} (b_1^*, a_1^\prime) & \text{atan2} (b_1^*, a_1^\prime) \geq 0^\circ \\ \text{atan2} (b_1^*, a_1^\prime) + 360^\circ & \text{otherwise} \end{cases} h_2^\prime=\begin{cases} 0 & b_2^* = 0, a_2^\prime = 0 \\ \text{atan2} (b_2^*, a_2^\prime) & \text{atan2} (b_2^*, a_2^\prime) \geq 0^\circ \\ \text{atan2} (b_2^*, a_2^\prime) + 360^\circ & \text{otherwise} \end{cases} The inverse tangent (tan −1 ) can be computed using a common library routine atan2(b, ) which usually has a range from −π to π radians; color specifications are given in 0 to 360 degrees, so some adjustment is needed. The inverse tangent is indeterminate if both and b are zero (which also means that the corresponding is zero); in that case, set the hue angle to zero. See . The example above expects the parameter order of atan2 to be atan2(y, x) . \Delta h' = \begin{cases} h_2^\prime - h_1^\prime & \left| h_2^\prime - h_1^\prime \right| \leq 180^\circ \\ \left( h_2^\prime - h_1^\prime \right) - 360^\circ & \left(h_2^\prime - h_1^\prime \right) > 180^\circ \\ \left( h_2^\prime - h_1^\prime \right) + 360^\circ & \left(h_2^\prime - h_1^\prime \right) When either 1 or 2 is zero, then Δ is irrelevant and may be set to zero. See . \Delta H^\prime = 2 \sqrt{C_1^\prime C_2^\prime} \sin \left(\frac{\Delta h^\prime}{2} \right), \quad \bar{h}^\prime=\begin{cases} \left(\frac{h_1^\prime + h_2^\prime}{2} \right) & \left| h_1^\prime - h_2^\prime \right| \leq 180^\circ \\ \left(\frac{h_1^\prime + h_2^\prime + 360^\circ}{2} \right) & \left| h_1^\prime - h_2^\prime \right| > 180^\circ, h_1^\prime + h_2^\prime 180^\circ, h_1^\prime + h_2^\prime \geq 360^\circ \\ \end{cases} When either 1 or 2 is zero, then is 1 + 2 (no divide by 2; essentially, if one angle is indeterminate, then use the other angle as the average; relies on indeterminate angle being set to zero). See stating most implementations on the Internet at the time had "an error in the computation of average hue". T = 1 - 0.17 \cos ( \bar{h}^\prime - 30^\circ ) + 0.24 \cos (2\bar{h}^\prime) + 0.32 \cos (3\bar{h}^\prime + 6^\circ ) - 0.20 \cos (4\bar{h}^\prime - 63^\circ) S_L = 1 + \frac{0.015 \left( \bar{L} - 50 \right)^2}{\sqrt{20 + {\left(\bar{L} - 50 \right)}^2} } \quad S_C = 1+0.045 \bar{C}^\prime \quad S_H = 1+0.015 \bar{C}^\prime T R_T = -2 \sqrt{\frac{\bar{C}'^7}{\bar{C}'^7+25^7}} \sin \left[ 60^\circ \cdot \exp \left( -\left[ \frac{\bar{h}'-275^\circ}{25^\circ} \right]^2 \right) \right] CIEDE 2000 is not mathematically continuous. The discontinuity stems from the discontinuity of the mean hue \bar{h}^\prime and the hue difference \Delta h' . The maximum discontinuity happens when the hues of two sample colors are about 180° apart, and is usually small relative to ΔE (less than 4%). There is also a negligible amount of discontinuity from hue rollover. Sharma, Wu, and Dalal have provided additional notes on the mathematics and implementation of the formulae.

Tolerance

. The ellipses are shown ten times their actual size.]] Tolerancing concerns the question "What is a set of colors that are imperceptibly/acceptably close to a given reference?" If the distance measure is perceptually uniform, then the answer is simply "the set of points whose distance to the reference is less than the just-noticeable-difference (JND) threshold". This requires a perceptually uniform metric in order for the threshold to be constant throughout the gamut (range of colors). Otherwise, the threshold will be a function of the reference color—cumbersome as a practical guide. In the CIE 1931 color space, for example, the tolerance contours are defined by the MacAdam ellipse, which holds L* (lightness) fixed. As can be observed on the adjacent diagram, the ellipses denoting the tolerance contours vary in size. It is partly this non-uniformity that led to the creation of CIELUV and CIELAB. More generally, if the lightness is allowed to vary, then we find the tolerance set to be ellipsoidal. Increasing the weighting factor in the aforementioned distance expressions has the effect of increasing the size of the ellipsoid along the respective axis. The definition of "acceptably close" also depends on the industrial requirements and practicality. In the automotive industry the is rather stringent, often less than 0.5 under D65/10. In printing, the typical limit is 2.0 under D50, though some processes require up to 5.0.

See also

CIELAB Color coding in data visualization

Footnotes

Further reading

External links

Bruce Lindbloom's color difference calculator. Uses all CIELAB metrics defined herein. The CIEDE2000 Color-Difference Formula, by Gaurav Sharma. Implementations in MATLAB and Excel. Explore the Spectrum with Colors in Between, by Bettie M. Cobb. Excel add-in for color difference calculations and color space conversions, by Edgardo García. Michel Leonard's CIE ΔE 2000 implementations consistent in 40+ programming languages. Online CIELAB Tools: LCh Conversion, Spectra-to-Lab for Liquids, and ΔE/ΔE00, free web tools

Text derived from https://en.wikipedia.org/w/index.php?oldid=1377652933 under CC BY-SA 4.0; modifications have been made.

References

  1. ↩Wikipedia publication date (×1) · confidence 0.95 https://en.wikipedia.org/w/index.php?oldid=1377652933

Sources cited in this revision

Extracted from the cited revision's reference blocks; absent citations are not invented.