Validation of CIEDE2000 color-difference formula implementation using test data from Sharma, Wu & Dalal 2004¶
Victor Lima
victor.lima@ufscar.br
victorportog.github.io
Release date:
21 October 2025
Last modification:
21 October 2025
This file is part of SkinOptics documentation.
References:
[SWD04] Sharma, Wu & Dalal 2004.
The CIEDE2000 Color-Difference Formula: Implementation Notes, Supplementary Test Data, and Mathematical Observations.
https://doi.org/10.1002/col.20070
In [1]:
import numpy as np
import matplotlib
from matplotlib import rcParams
from matplotlib import style
import matplotlib.pyplot as plt
import pandas as pd
In [2]:
print('numpy version:', np.__version__)
print('matplotlib version:', matplotlib.__version__)
print('pandas version:', pd.__version__)
numpy version: 2.3.4 matplotlib version: 3.10.7 pandas version: 2.3.3
In [3]:
rcParams.update({'font.size': 12})
rcParams.update({'axes.labelsize': 12})
rcParams.update({'axes.titlesize': 12})
rcParams.update({'xtick.labelsize': 12})
rcParams.update({'ytick.labelsize': 12})
rcParams.update({'legend.fontsize': 10})
rcParams.update({'axes.grid': True})
plt.rcParams["figure.figsize"] = (6, 4)
In [4]:
import skinoptics
from skinoptics.dataframes import *
from skinoptics.colors import *
In [5]:
print('skinoptics version:', skinoptics.__version__)
skinoptics version: 0.0.2
In [6]:
Sharma2004_TableI_dataframe.head(8)
Out[6]:
| pair | i | L | a | b | al | Cl | hl | hl_bar | G | T | SL | SC | SH | RT | Delta_E_00 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | 1 | 50.0 | 2.6772 | -79.7751 | 2.6774 | 79.8200 | 271.9222 | 270.9611 | 0.0001 | 0.6907 | 1.0 | 4.6578 | 1.8421 | 1.7042 | 2.0425 |
| 1 | 1 | 2 | 50.0 | 0.0000 | -82.7485 | 0.0000 | 82.7485 | 270.0000 | 270.9611 | 0.0001 | 0.6907 | 1.0 | 4.6578 | 1.8421 | 1.7042 | 2.0425 |
| 2 | 2 | 1 | 50.0 | 3.1571 | -77.2803 | 3.1573 | 77.3448 | 272.3395 | 271.1698 | 0.0001 | 0.6843 | 1.0 | 4.6021 | 1.8216 | 1.7070 | 2.8615 |
| 3 | 2 | 2 | 50.0 | 0.0000 | -82.7485 | 0.0000 | 82.7485 | 270.0000 | 271.1698 | 0.0001 | 0.6843 | 1.0 | 4.6021 | 1.8216 | 1.7070 | 2.8615 |
| 4 | 3 | 1 | 50.0 | 2.8361 | -74.0200 | 2.8363 | 74.0743 | 272.1944 | 271.0972 | 0.0001 | 0.6865 | 1.0 | 4.5285 | 1.8074 | 1.7060 | 3.4412 |
| 5 | 3 | 2 | 50.0 | 0.0000 | -82.7485 | 0.0000 | 82.7485 | 270.0000 | 271.0972 | 0.0001 | 0.6865 | 1.0 | 4.5285 | 1.8074 | 1.7060 | 3.4412 |
| 6 | 4 | 1 | 50.0 | -1.3802 | -84.2814 | 1.3803 | 84.2927 | 269.0618 | 269.5309 | 0.0001 | 0.7357 | 1.0 | 4.7584 | 1.9217 | 1.6809 | 1.0000 |
| 7 | 4 | 2 | 50.0 | 0.0000 | -82.7485 | 0.0000 | 82.7485 | 270.0000 | 269.5309 | 0.0001 | 0.7357 | 1.0 | 4.7584 | 1.9217 | 1.6809 | 1.0000 |
In [7]:
Sharma2004_TableI_array = np.array(Sharma2004_TableI_dataframe)
In [8]:
Delta_E_00_Sharma2004 = np.zeros((34))
for i in range(34):
Delta_E_00_Sharma2004[i] = Sharma2004_TableI_array[2*i,-1]
In [9]:
Delta_E_00_skinoptics = np.zeros((34))
for i in range(34):
Delta_E_00_skinoptics[i] = Delta_E_00(*Sharma2004_TableI_array[2*i,2:5],
*Sharma2004_TableI_array[2*i+1,2:5])
In [10]:
plt.scatter(np.arange(1, 34+1, 1), Delta_E_00_Sharma2004, color = 'b', marker = 'x',
label = 'Sharma, Wu & Dalal 2004')
plt.scatter(np.arange(1, 34+1, 1), Delta_E_00_skinoptics, color = 'c', marker = '.',
label = 'skinoptics.colors')
plt.xlabel('pair index [-]')
plt.ylabel('$\\Delta$E*$_{00}$ [-]')
plt.legend(loc = 'upper left')
plt.xlim(1, 34)
plt.ylim(0, 40)
plt.show()
In [11]:
plt.scatter(np.arange(1, 34+1, 1), np.abs(Delta_E_00_skinoptics/Delta_E_00_Sharma2004 - 1)*1E5,
color = 'gray', marker = 'o')
plt.xlabel('pair index [-]')
plt.ylabel('relative diff. in $\\Delta$E*$_{00}$ [10$^{-5}$]')
plt.xlim(1, 34)
plt.ylim(0, 6)
plt.show()