Transcription of The CIEDE2000 color-difference formula: Implementation ...
1 The CIEDE2000 color -DifferenceFormula: Implementation Notes,Supplementary Test Data, andMathematical ObservationsGaurav Sharma,1* Wencheng Wu,2 Edul N. Dalal21 ECE Department and Department of Biostatistics and Computational Biology, University of Rochester,Rochester, NY 14627-01262 Xerox Corporation, 800 Phillips Road, Webster, NY 14580 Received 28 January 2004; accepted 15 April 2004 Abstract: This article and the associated data and programsprovided with it are intended to assist color engineers andscientists in correctly implementing the recently developedCIEDE2000 color -difference formula . We indicate severalpotential Implementation errors that are not uncovered intests performed using the original sample data publishedwith the standard. A supplemental set of data is provided forcomprehensive testing of implementations. The test data,Microsoft Excel spreadsheets, and MATLAB scripts forevaluating the CIEDE2000 color difference are made avail-able at the first author s website.
2 Finally, we also point outsmall mathematical discontinuities in the formula . 2004 Wiley Periodicals, Inc. Col Res Appl, 30, 21 30, 2005; Published online inWiley InterScience ( ). DOI words: color -difference metrics; CIE; cielab ; CIE94; CIEDE2000 ; CMCINTRODUCTIONThe CIEDE2000 formula was published by the CIE by members of CIE Technical Committee1-47, the formula provides an improved procedure for thecomputation of industrial color differences . The methodol-ogy used for developing the formula from experimentalcolor-difference data was described by Luo, Cui, and Rigg2in an article published in this journal. The article alsoincluded the equations for the computation of theCIEDE2000 color difference as an CIEDE2000 formula is considerably more sophisticatedand computationally involved than its predecessor color -dif-ference equations for CIELAB3 E*aband the CIE944color-difference E94.
3 Therefore it is important to verify that soft-ware implementations for computing color differences basedon the new formula are extensively tested prior to their de-ployment. Toward this end, both the CIEDE2000 publicationsmentioned in the previous paragraph included an identical setof worked examples for confirmation of software imple-mentation of CIEDE2000 . 1 However, these worked exam-ples are a small set and do not adequately test the imple-mentation of the CIEDE2000 formula . We discovered thislimitation, in our efforts to implement the formula andvalidate it against publicly available implementations on theWorld Wide Web. In this process, we found several inde-pendent implementations. For the worked examples in-cluded in the CIE technical report on CIEDE20001all ofthese implementations provided results that were in agree-ment with the published data (up to reasonable numericalprecision).
4 However, upon further testing, we discoveredthat on additional data, the results for the different imple-mentations were different. In fact, several of the implemen-tations distributed on the Internet, including some fromreputable sources, were erroneous. Several of our own earlyimplementations of the formula were also in this category ofimplementations that are erroneous but nevertheless providecorrect results over the limited set of worked examplesincluded with the draft standard. We therefore believe that* Correspondence to: G. Sharma (e-mail: 2004 Wiley Periodicals, 30, Number 1, February 200521correct Implementation of the CIEDE2000 formula is non-trivial and our goal in this article is to assist in this article has three main contributions. First, we pro-vide a comprehensive set of data for testing software im-plementations of the CIEDE2000 color -difference data are specifically designed for exercising compo-nents in the CIEDE2000 equations that may be erroneouslycomputed and are not exercised by the original workedexamples included with the draft standard.)
5 We also pointout several of the common errors and indicate parts of thetest data that help identify these. Second, we provide im-plementations of the CIEDE2000 color -difference formulain Microsoft Excel and implementationsagree with the original worked examples included in theCIE Technical Report and with each other on the supple-mental data included in this article. We believe these to becorrect implementations of the equations. Third, we high-light and characterize discontinuities in the CIEDE2000color-difference formula that arise from its defining article addresses only the computational and math-ematical aspects of the CIEDE2000 equations and does notin any way address psychophysical evaluation of the for-mula, attempt to improve its uniformity, or define its do-main of applicability.
6 Some comments of that nature areincluded in the notes by Kuehni6and Luoet this CIEDE2000 color -DIFFERENCE FORMULAIn this section, we briefly outline the equations for thecomputation of the CIEDE2000 color difference. The de-scription follows the presentation of Luo, Cui, and Rigg2butis slightly modified to make it closer to an algorithmicstatement. It is included here to relate Implementation notesand comments in subsequent sections to the equations pre-sented CIEDE2000 color -difference formula is based on theCIELAB color space. Given a pair of color values inCIELAB spaceL*1,a*1,b*1andL*2,a*2,b*2, we denote theCIEDE2000 color difference between them as follows : E00 L*1,a*1,b*1;L*2,a*2,b*2 E0012 E00.(1)Given two cielab color values {L*i,a*i,b*i}i 12and para-metric weighting factorskL,kC, andkH, the process ofcomputation of the color difference is summarized in thefollowing equations, grouped as three main CalculateC i,h i:C*i,ab a*i 2 b*i 2i 1, 2(2)C *ab C*1,ab C*2,ab2(3)G 1 C *ab7C *ab7 257 (4)a i 1 G a*ii 1, 2(5)C i a i 2 b*i 2i 1, 2(6)h i 0b*i a i 0tan 1 b*i,a i otherwisei 1, 2(7)2.
7 Calculate L , C , H : L L*2 L*1(8) C C 2 C 1(9) h 0C 1C 2 0h 2 h 1C 1C 2 0; h 2 h 1 180 h 2 h 1 360C 1C 2 0; h 2 h 1 180 h 2 h 1 360C 1C 2 0; h 2 h 1 180 (10) H 2 C 1C 2sin h 2 (11)3. Calculate CIEDE2000 color -Difference E00:L L*1 L*2 / 2(12)C C 1 C 2 / 2(13)h h 1 h 22 h 1 h 2 180 ;C 1C 2 0h 1 h 2 360 2 h 1 h 2 180 ; h 1 h 2 360 ;C 1C 2 0h 1 h 2 360 2 h 1 h 2 180 ; h 1 h 2 360 ;C 1C 2 0 h 1 h 2 C 1C 2 0(14)T 1 cos h 30 cos 2h cos 3h 6 cos 4h 63 (15) 30 exp h 275 25 2 (16)RC 2 C 7C 7 257(17)SL 1 L 50 2 20 L 50 2(18)SC 1 (19)SH 1 T(20)RT sin 2 RC(21) E0012 E00 L*1,a*1,b*1;L*2,a*2,b*2 L kLSL 2 C kCSC 2 H kHSH 2 RT C kCSC H kHSH . (22) The commonly accepted notation is simply E00, however, in certaincases, we will find it useful to use the longer and more explicit research and applicationSeveral notes clarifying the Implementation of the aboveequations are helpful:1.
8 The definition of the modified hueh iin Eq. (7) uses afour-quadrant arctangent. The modified hueh ihas thegeometric interpretation in the two dimensionala b*plane as the angular position of the point (a i,b*i) mea-sured from the positivea axis. To emphasize this weuse the notation tan 1(b*i,a i) as opposed to the morecommon notation tan 1 b*i/a i . The four-quadrant arc-tangent may be readily obtained using the two argumentinverse tangent function available in several program-ming environments. Typically, these functions return anangular value in radians ranging from to . Thismust be converted to a hue angle in degrees between 0 and 360 by addition of 2 to negative hue angles,followed by a multiplication by 180/ to convert fromradians to degrees. This will provide a result consistentwith subsequent equations.
9 For the case whereb*i a i 0, the modified hue is indeterminate and we havedefined it as zero, a fact that we exploit in Eq. (14).2. The chroma difference C in Eq. (9) and the huedifference H in Eq. (11) should be computed as signeddifferences as indicated in the equations and not asabsolute values of the differences . Although the equa-tions defining the CIEDE2000 formula1,2are unambigu-ous in this respect, implementers may be susceptible tomaking this error. The CIELAB3 E*aband the CIE944 E94color differences used only terms in H2and C2hence required only the absolute value of the hue differ-ence. This we conjecture might lead software imple-menters to use the absolute values for the hue andchroma difference when they begin with existing imple-mentations of earlier color -difference equations. Thisimplementation error is hard to detect, because the signof the hue and chroma differences plays a role only in thefollowing cross term:RT C kCSC H kHSH in Eq.
10 (22). Its impact is localized in the blue hueregion (around 275 ), outside of which and there-fore theRTterm is rather small. Therefore the error ofignoring the sign of the hue and chroma difference isnot readily diagnosed unless specifically tested The computation of the hue angle difference in Eq. (10)is based on the description in the CIE Technical addition, we use the reasonable interpretation that thehue difference between the origin in thea b* plane andany point in the plane is zero. The article by Luo, Cui,and Rigg2does not fully describe the hue-differencecomputation. Using the arithmetic difference directly canresult in an incorrect sign for the metric hue difference H in Eq. (11). Additional details may also be found inSe` The computation of the mean hueh used in Eq. (14) isnot defined unambiguously in either the CIE TechnicalReport1or the article by Luo, Cui and mostcomputations of angle, any ambiguities of 360 may beignored.