from colorchecker2cielab import delta_E_CIE2000_adapted, read_basiccolor_data
import pandas as pdA dive into deltaE CIE2000
The most recent Metamorfoze standard (ref?) prescribes that for assessing color differences one should use the newest CIE2000 deltaE formula, with the addition that SL=1. So far I managed to avoid the complexities of CIE2000, but it seems that now we can longer ignore its inner workings. Here is the formula for the CIE 2000 color difference.
\[ \Delta E^*_{00} = \sqrt{\left(\frac{\Delta L'}{k_L \color{red}{S_L} }\right)^2 + \left(\frac{\Delta C'}{k_C S_C}\right)^2 + \left(\frac{\Delta H'}{k_H S_H }\right)^2 + \left(R_T \left(\frac{\Delta C'}{K_C S_C}\right) \left(\frac{\Delta H'}{k_H S_H}\right)\right)} \]
The important thing to note here is that we find indeed a coefficient SL in the denominator of the first term. Note that this coefficient is not constant but a function that depends on the CIELAB inputs! Further specification of the variables in this formula in terms of CIELAB input values would require 27 more lines of math. If you are curious, see the Math > DeltaE (CIE 2000) section of www.brucelindbloom.com.
To study the effect of setting SL=1, I created the delta_E_CIE2000_adapted() function. Let’s see if we can now replicate the BasICColor Metamorfoze (SL=1) report values…
# read BasICColor report data
bcol_data = '/home/frank/Work/DATA/colorchecker2cielab-data/BasiCColor_sk-c-1833.xlsx'
bcol_df = read_basiccolor_data(bcol_data)# select CIELAB values needed to compute deltaE
ref_LABs = bcol_df.loc[:, ['ref_L*', 'ref_a*', 'ref_b*']].values
bcol_LABs = bcol_df.loc[:, ['bcol_L*', 'bcol_a*', 'bcol_b*']].values
bcol_deltaE_SL1 = bcol_df.loc[:, ['bcol_ΔE*00_(SL=1)']]computed_deltaE_SL1 = delta_E_CIE2000_adapted(ref_LABs, bcol_LABs, metamorfoze_SL_is_one=True)
compare_df = bcol_deltaE_SL1
compare_df['computed'] = computed_deltaE_SL1
pd.options.display.float_format = '{:,.2f}'.format
print(compare_df.to_string()); bcol_ΔE*00_(SL=1) computed
A1 0.77 0.76
B1 1.05 1.05
C1 1.97 1.97
D1 0.68 0.68
E1 1.00 1.00
F1 2.24 2.24
G1 0.67 0.67
H1 0.98 0.98
I1 2.05 2.05
J1 0.64 0.63
K1 1.01 1.02
L1 2.70 2.70
M1 0.94 0.93
N1 0.69 0.69
A2 2.28 2.28
B2 1.77 1.77
C2 1.19 1.19
D2 1.03 1.03
E2 1.04 1.05
F2 1.55 1.55
G2 0.82 0.82
H2 0.49 0.49
I2 1.11 1.11
J2 1.28 1.28
K2 0.74 0.75
L2 1.73 1.73
M2 1.48 1.49
N2 0.94 0.94
A3 1.09 1.09
B3 0.62 0.61
C3 1.19 1.20
D3 0.58 0.58
E3 1.15 1.15
F3 1.86 1.86
G3 1.79 1.79
H3 0.82 0.82
I3 1.47 1.47
J3 1.01 1.01
K3 1.03 1.04
L3 2.24 2.25
M3 0.70 0.69
N3 2.26 2.26
A4 0.76 0.76
B4 0.90 0.90
C4 0.62 0.62
D4 0.66 0.65
E4 1.82 1.82
F4 2.06 2.05
G4 1.98 1.98
H4 1.69 1.69
I4 1.45 1.45
J4 2.02 2.02
K4 0.71 0.71
L4 1.16 1.15
M4 1.80 1.80
N4 0.82 0.83
A5 1.58 1.58
B5 1.66 1.66
C5 1.05 1.04
D5 0.42 0.43
E5 0.64 0.64
F5 0.94 0.94
G5 1.02 1.02
H5 1.02 1.02
I5 1.04 1.04
J5 1.36 1.36
K5 0.89 0.89
L5 1.33 1.33
M5 2.09 2.09
N5 1.03 1.04
A6 1.03 1.03
B6 0.88 0.88
C6 1.82 1.82
D6 1.44 1.43
E6 2.08 2.08
F6 1.03 1.04
G6 1.08 1.08
H6 1.05 1.05
I6 0.93 0.93
J6 0.77 0.77
K6 0.94 0.94
L6 1.74 1.74
M6 1.94 1.94
N6 2.59 2.58
A7 0.67 0.67
B7 4.11 4.11
C7 0.93 0.93
D7 1.12 1.12
E7 1.01 1.00
F7 1.02 1.03
G7 3.99 3.99
H7 0.75 0.75
I7 0.60 0.60
J7 0.52 0.52
K7 1.08 1.08
L7 2.21 2.21
M7 2.14 2.14
N7 0.77 0.76
A8 1.71 1.71
B8 1.80 1.80
C8 3.17 3.17
D8 1.43 1.43
E8 0.76 0.76
F8 0.46 0.46
G8 0.78 0.78
H8 1.08 1.08
I8 0.87 0.87
J8 0.50 0.49
K8 0.80 0.80
L8 1.01 1.02
M8 1.88 1.89
N8 0.98 0.97
A9 0.98 0.99
B9 1.92 1.91
C9 1.15 1.15
D9 1.92 1.92
E9 1.82 1.82
F9 1.64 1.64
G9 0.94 0.94
H9 0.86 0.86
I9 0.68 0.68
J9 0.92 0.92
K9 1.47 1.46
L9 2.11 2.11
M9 3.01 3.01
N9 2.21 2.21
A10 0.64 0.64
B10 0.99 0.99
C10 1.61 1.61
D10 0.58 0.59
E10 0.99 0.99
F10 1.72 1.72
G10 0.66 0.66
H10 1.01 1.01
I10 1.88 1.89
J10 0.66 0.66
K10 0.97 0.97
L10 2.03 2.03
M10 1.02 1.01
N10 0.72 0.71
Conclusion is that we can indeed replicate the CIE2000(SL=1) deltaE values.
However, I can’t see yet why we should follow the Metamorfoze Standard recommendation…
delta_E_CIE2000_adapted
delta_E_CIE2000_adapted (Lab_1, Lab_2, textiles=False, metamorfoze_SL_is_one=False)
Return the difference :math:\Delta E_{00} between two given CIE L*a*b** colourspace arrays using CIE 2000 recommendation.
ADAPTED BY FRANK LIGTERINK TO INCLUDE THE CURIOUS OPTION: metamorfoze_SL_is_one*
| Type | Default | Details | |
|---|---|---|---|
| Lab_1 | CIE L*a*b* colourspace array 1. | ||
| Lab_2 | CIE L*a*b* colourspace array 2. | ||
| textiles | bool | False | Textiles application specific parametric factors. :math: k_L=2,\ k_C=k_H=1 weights are used instead of:math: k_L=k_C=k_H=1. |
| metamorfoze_SL_is_one | bool | False | |
| Returns | :class:numpy.ndarray |
Colour difference :math:\Delta E_{00}. |