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

### sRGB

As most definitions of color difference are distances within a color space, the standard means of determining distances is the Euclidean distance. If one presently has an RGB (red, green, blue) tuple and wishes to find the color difference, computationally one of the easiest is to consider R, G, B linear dimensions defining the color space.

A very simple example can be given between the two colors with RGB values (0, 64, 0) () and (255, 64, 0) (): their distance is 255. Going from there to (255, 64, 128) () is a distance of 128.

When we wish to calculate distance from the first point to the third point (i.e. changing more than one of the color values), we can do this:

${\displaystyle {\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

${\displaystyle {\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 WAS 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 to better fit human perception, where the components are commonly weighted (red 30%, green 59%, and blue 11%), however, these are demonstrably[citation needed] 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):[1]

${\displaystyle {\begin{cases}{\sqrt {2\Delta R^{2}+4\Delta G^{2}+3\Delta B^{2))},&{\bar {R))<128,\\{\sqrt {3\Delta R^{2}+4\Delta G^{2}+2\Delta B^{2))}&{\text{otherwise)),\end{cases))}$

where:

{\displaystyle {\begin{aligned}\Delta R&=R_{1}-R_{2},\\\Delta G&=G_{1}-G_{2},\\\Delta B&=B_{1}-B_{2},\\{\bar {R))&={\frac {1}{2))(R_{1}+R_{2}).\end{aligned))}

One of the better low-cost approximations, sometimes called "redmean", combines the two cases smoothly:[1]

{\displaystyle {\begin{aligned}{\bar {r))&={\frac {1}{2))(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.[citation needed]

### Uniform color spaces

CIELAB and CIELUV are relatively perceptually-uniform color spaces and they have been used as spaces for Euclidean measures of color difference. The CIELAB version is known as CIE76. However, the non-uniformity of these spaces were later discovered, leading to the creation of more complex formulae.

Uniform color space: a color space in which equivalent numerical differences represent equivalent visual differences, regardless of location within the color space. A truly uniform color space has been the goal of color scientists for many years. Most color spaces, though not perfectly uniform, are referred to as uniform color spaces, since they are more nearly uniform when compared to the chromaticity diagram.

— X-rite glossary[2]

A uniform color space is supposed to make a simple measure of color difference, usually Euclidean, "just work". Color spaces that improve on this issue include CAM02-UCS, CAM16-UCS, and Jzazbz.[3]

#### Rec. ITU-R BT.2124 or ΔEITP

In 2019 a new standard for WCG and HDR was introduced, since CIEDE2000 was not adequate for it: CIEDE2000 is not reliable below 1 cd/m2 and has not been verified above 100 cd/m2; in addition, even in BT.709 blue primary CIEDE2000 is underpredicting the error.[4] ΔEITP is scaled so that a value of 1 indicates the potential of a just noticeable color difference. The ΔEITP color difference metric is derived from display referenced ICTCP, but XYZ is also available in the standard. The formula is a simply scaled Euclidean distance:[5]

${\displaystyle \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 CT,
P = CP.

### Other geometric constructions

The Euclidean measure is known to work poorly on large color distances (i.e. more than 10 units in most systems). A hybrid approach where a taxicab distance is used between the lightness and the chroma plane, ${\textstyle \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 on CIELAB.[6]

## CIELAB ΔE*

This section is missing information about acceptability difference values in industry. Please expand the section to include this information. Further details may exist on the talk page. (July 2021)
This section may require cleanup to meet Wikipedia's quality standards. The specific problem is: Should reorder chronologically (move CMC between 76 and 94, then rephrase accordingly) as it looks like an inspiration for the move to LCh. Please help improve this section if you can. (February 2022) (Learn how and when to remove this template message)

The International Commission on Illumination (CIE) calls their distance metric ΔE* (also inaccurately called dE*, dE, 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.[7][8]

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.[9] 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 ΔE may be insignificant between two colors in one part of the color space while being significant in some other part.[10]

All ΔE* 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 ΔEITP.[11] However, further experimentation may invalidate this design assumption, the revision of CIE76 ΔE*ab JND to 2.3 being an example.[12]

### CIE76

The 1976 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, ${\textstyle ({L_{1}^{*)),{a_{1}^{*)),{b_{1}^{*)))}$ and ${\textstyle ({L_{2}^{*)),{a_{2}^{*)),{b_{2}^{*)))}$, the CIE76 color difference formula is defined as:

${\displaystyle \Delta E_{ab}^{*}={\sqrt {(L_{2}^{*}-L_{1}^{*})^{2}+(a_{2}^{*}-a_{1}^{*})^{2}+(b_{2}^{*}-b_{1}^{*})^{2))}.}$

${\textstyle \Delta E_{ab}^{*}\approx 2.3}$ corresponds to a JND (just noticeable difference).[12]

### CIE94

The 1976 definition was extended to address perceptual non-uniformities, while retaining the CIELAB color space, by the introduction of application-specific weights derived from an automotive paint test's tolerance data.[11]

ΔE (1994) is defined in the L*C*h* color space with differences in lightness, chroma and hue calculated from L*a*b* coordinates. Given a reference color[a] ${\displaystyle (L_{1}^{*},a_{1}^{*},b_{1}^{*})}$ and another color ${\displaystyle (L_{2}^{*},a_{2}^{*},b_{2}^{*})}$, the difference is[13][14][15]

${\displaystyle \Delta E_{94}^{*}={\sqrt {\left({\frac {\Delta L^{*)){k_{L}S_{L))}\right)^{2}+\left({\frac {\Delta C_{ab}^{*)){k_{C}S_{C))}\right)^{2}+\left({\frac {\Delta H_{ab}^{*)){k_{H}S_{H))}\right)^{2))},}$

where

{\displaystyle {\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_{ab}^{*}&=C_{1}^{*}-C_{2}^{*},\\\Delta H_{ab}^{*}&={\sqrt ((\Delta E_{ab}^{*))^{2}-{\Delta L^{*))^{2}-{\Delta C_{ab}^{*))^{2))}={\sqrt ((\Delta a^{*))^{2}+{\Delta b^{*))^{2}-{\Delta C_{ab}^{*))^{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 kC and kH are usually both unity, and the weighting factors kL, K1 and K2 depend on the application:

graphic arts textiles
${\displaystyle k_{L))$ 1 2
${\displaystyle K_{1))$ 0.045 0.048
${\displaystyle K_{2))$ 0.015 0.014

Geometrically, the quantity ${\displaystyle \Delta H_{ab}^{*))$ corresponds to the arithmetic mean of the chord lengths of the equal chroma circles of the two colors.[16]

### CIEDE2000

Since the 1994 definition did not adequately resolve the perceptual uniformity issue, the CIE refined their definition, adding five corrections:[17][18]

• A hue rotation term (RT), to deal with the problematic blue region (hue angles in the neighborhood of 275°):[19]
• Compensation for neutral colors (the primed values in the L*C*h differences)
• Compensation for lightness (SL)
• Compensation for chroma (SC)
• Compensation for hue (SH)

${\displaystyle \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))))))$

Note: The formulae below should use degrees rather than radians; the issue is significant for RT.
The kL, kC, and kH are usually unity.

${\displaystyle \Delta L^{\prime }=L_{2}^{*}-L_{1}^{*))$

${\displaystyle {\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 }$

${\displaystyle 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)}$

${\displaystyle {\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 }$

${\displaystyle h_{1}^{\prime }={\text{atan2))(b_{1}^{*},a_{1}^{\prime })\mod 360^{\circ },\quad h_{2}^{\prime }={\text{atan2))(b_{2}^{*},a_{2}^{\prime })\mod 360^{\circ ))$

Note: The inverse tangent (tan−1) can be computed using a common library routine atan2(b, a′) 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 a′ and b are zero (which also means that the corresponding C′ is zero); in that case, set the hue angle to zero. See Sharma 2005, eqn. 7.
Note: The example above expects the parameter order of atan2 to be atan2(y, x). See implementation in [20]

${\displaystyle \Delta h'={\begin{cases}h_{2}^{\prime }-h_{1}^{\prime }&\left|h_{1}^{\prime }-h_{2}^{\prime }\right|\leq 180^{\circ }\\h_{2}^{\prime }-h_{1}^{\prime }+360^{\circ }&\left|h_{1}^{\prime }-h_{2}^{\prime }\right|>180^{\circ },h_{2}^{\prime }\leq h_{1}^{\prime }\\h_{2}^{\prime }-h_{1}^{\prime }-360^{\circ }&\left|h_{1}^{\prime }-h_{2}^{\prime }\right|>180^{\circ },h_{2}^{\prime }>h_{1}^{\prime }\end{cases))}$

Note: When either C′1 or C′2 is zero, then Δh′ is irrelevant and may be set to zero. See Sharma 2005, eqn. 10.

### References

1. ^ a b "Colour metric". Compu Phase.
2. ^ "Color Glossary". X-Rite.
3. ^ Li, Changjun; Li, Zhiqiang; Wang, Zhifeng; et al. (December 2017). "Comprehensive color solutions: CAM16, CAT16, and CAM16-UCS". Color Research & Application. 42 (6): 703–718. doi:10.1002/col.22131.
4. ^ "What Is ICtCp – Introduction?" (PDF). Dolby. Version 7.1. Archived (PDF) from the original on 2016-05-08.
5. ^ "Objective metric for the assessment of the potential visibility of colour differences in television" (PDF). BT Series: Broadcasting service (television). International Telecommunication Union. January 2019. Recommendation ITU-R BT.2124-0.
6. ^ Abasi, Saeedeh; Amani Tehran, Mohammad; Fairchild, Mark D. (April 2020). "Distance metrics for very large color differences". Color Research & Application. 45 (2): 208–223. doi:10.1002/col.22451. S2CID 209914019.
7. ^ Backhaus, W.; Kliegl, R.; Werner, J. S. (1998). Color Vision: Perspectives from Different Disciplines. Walter de Gruyter. p. 188. ISBN 9783110154313. Retrieved 2014-12-02.
8. ^ Valberg, A. (2005). Light Vision Color. Wiley. p. 278. ISBN 9780470849026. Retrieved 2014-12-02.
9. ^ Fraser, Bruce; Bunting, Fred; Murphy, Chris (2004). Real World Color Management (2nd ed.). Pearson Education. ISBN 9780132777957.
10. ^ Evaluation of the CIE Color Difference Formulas
11. ^ a b "Delta E: The Color Difference". Colorwiki.com. Retrieved 2009-04-16.
12. ^ a b Sharma, Gaurav (2003). Digital Color Imaging Handbook (1.7.2 ed.). CRC Press. ISBN 0-8493-0900-X.
13. ^ Lindbloom, Bruce Justin. "Delta E (CIE 1994)". Brucelindbloom.com. Retrieved 2011-03-23.
14. ^ "Colour Difference Software by David Heggie". Colorpro.com. 1995-12-19. Retrieved 2009-04-16.
15. ^ Colorimetry - Part 4: CIE 1976 L*a*b* Colour Space (Report). Draft Standard. CIE. 2007. CIE DS 014-4.3/E:2007.
16. ^ Klein, Georg A. (2010-05-18). Industrial Color Physics. Springer. p. 147. ISBN 978-1-4419-1196-4.
17. ^ Sharma, Gaurav; Wu, Wencheng; Dalal, Edul N. (2005). "The CIEDE2000 color-difference formula: Implementation notes, supplementary test data, and mathematical observations" (PDF). Color Research & Application. 30 (1). Wiley Interscience: 21–30. doi:10.1002/col.20070.
18. ^ Lindbloom, Bruce Justin. "Delta E (CIE 2000)". Brucelindbloom.com. Retrieved 2009-04-16.
19. ^ The "Blue Turns Purple" Problem, Bruce Lindbloom
20. ^ Sharma, Gaurav. "The CIEDE2000 Color-Difference Formula". "Excel spreadsheet" hyperlink. Retrieved 2023-10-24.
21. ^ Meaning that the lightness contributes half as much to the difference (or, identically, is allowed twice the tolerance) as the chroma
22. ^ Lindbloom, Bruce Justin. "Delta E (CMC)". Brucelindbloom.com. Retrieved 2009-04-16.
23. ^ "CMC" (PDF). Insight on Color. 8 (13). 1–15 October 1996. Archived from the original (PDF) on 2006-03-12.
24. ^ Susan Hughes (14 January 1998). "A guide to Understanding Color Tolerancing" (PDF). Archived from the original (PDF) on 10 October 2015. Retrieved 2014-12-02.