Delta E (CIE 2000)

The color difference, or ΔE, between a sample color L2a2b2 and a reference color L1a1b1 is:

Equation 1

where

Equation 2

Implementation Notes:

  1. The angles supplied to the sin and cos functions are shown in degrees. Most math libraries expect radians, so don't forget to convert.
  2. The inverse tangent is also expressed in degrees. In most math libraries, the inverse tangent returns radians, so don't forget to convert.
  3. In computing hue angles, be careful with the inverse tangent since a could be zero. Instead, use special math functions to do this. In both the Standard C library and Java, this function is called atan2. In Microsoft Excel, it is called ATAN2. These special functions will compute the proper inverse tangents without needing to worry about "divide by zero" conditions.