Welcome

Guest

Log out

Subscription valid until 2014-11-28



















 

Color delta/comparison math

These are the formulas to calculate color differences. All of them refers to the CIE-L*ab color space.
Each formula is written as a "neutral programming function", easy to be translate in any specific computer language.
We did not post obvious deltas which involve a simple subtraction of two values.

Please keep in mind that implementing complex delta calculation (CMC, 1994, 2000) in your code may involve a lot of attention about the math itself and also the coding syntax.

Delta C*

Delta H*

Delta E*

Delta E 1994

CIE-L*1, CIE-a*1, CIE-b*1          //Color #1 CIE-L*ab values
CIE-L*2, CIE-a*2, CIE-b*2          //Color #2 CIE-L*ab values

WHT-L, WHT-C, WHT-H                //Weighting factors depending
                                   //on the application (1 = default)


xC1 = sqrt( ( CIE-a*1 ^ 2 ) + ( CIE-b*1 ^ 2 ) )
xC2 = sqrt( ( CIE-a*2 ^ 2 ) + ( CIE-b*2 ^ 2 ) )
xDL = CIE-L*2 - CIE-L*1
xDC = xC2 - xC1
xDE = sqrt( ( ( CIE-L*1 - CIE-L*2 ) * ( CIE-L*1 - CIE-L*2 ) )
          + ( ( CIE-a*1 - CIE-a*2 ) * ( CIE-a*1 - CIE-a*2 ) )
          + ( ( CIE-b*1 - CIE-b*2 ) * ( CIE-b*1 - CIE-b*2 ) ) )
if ( sqrt( xDE ) > ( sqrt( abs( xDL ) ) + sqrt( abs( xDC ) ) ) ) {
   xDH = sqrt( ( xDE * xDE ) - ( xDL * xDL ) - ( xDC * xDC ) )
}
else {
   xDH = 0
}
xSC = 1 + ( 0.045 * xC1 )
xSH = 1 + ( 0.015 * xC1 )
xDL /= WHT-L
xDC /= WHT-C * xSC
xDH /= WHT-H * xSH
Delta E94 = sqrt( xDL ^ 2 + xDC ^ 2 + xDH ^ 2 )

Top

Delta E 2000

Delta CMC