colour.difference.delta_e Module¶
\(\Delta E_{ab}\) - Delta E Colour Difference¶
Defines \(\Delta E_{ab}\) colour difference computation objects:
The following methods are available:
References
[1] | Wikipedia. (n.d.). Color difference. Retrieved August 29, 2014, from http://en.wikipedia.org/wiki/Color_difference |
-
colour.difference.delta_e.
delta_E_CIE1976
(Lab_1, Lab_2)[source]¶ Returns the difference \(\Delta E_{ab}\) between two given CIE Lab colourspace arrays using CIE 1976 recommendation.
Parameters: - Lab_1 (array_like) – CIE Lab colourspace array 1.
- Lab_2 (array_like) – CIE Lab colourspace array 2.
Returns: Colour difference \(\Delta E_{ab}\).
Return type: numeric or ndarray
See also
References
[2] Lindbloom, B. (2003). Delta E (CIE 1976). Retrieved February 24, 2014, from http://brucelindbloom.com/Eqn_DeltaE_CIE76.html Examples
>>> Lab_1 = np.array([100.00000000, 21.57210357, 272.22819350]) >>> Lab_2 = np.array([100.00000000, 426.67945353, 72.39590835]) >>> delta_E_CIE1976(Lab_1, Lab_2) 451.7133019...
-
colour.difference.delta_e.
delta_E_CIE1994
(Lab_1, Lab_2, textiles=False)[source]¶ Returns the difference \(\Delta E_{ab}\) between two given CIE Lab colourspace arrays using CIE 1994 recommendation.
Parameters: - Lab_1 (array_like) – CIE Lab colourspace array 1.
- Lab_2 (array_like) – CIE Lab colourspace array 2.
- textiles (bool, optional) – Textiles application specific parametric factors \(k_L=2,\ k_C=k_H=1,\ k_1=0.048,\ k_2=0.014\) weights are used instead of \(k_L=k_C=k_H=1,\ k_1=0.045,\ k_2=0.015\).
Returns: Colour difference \(\Delta E_{ab}\).
Return type: numeric or ndarray
Notes
CIE 1994 colour differences are not symmetrical: difference between Lab_1 and Lab_2 may not be the same as difference between Lab_2 and Lab_1 thus one colour must be understood to be the reference against which a sample colour is compared.
References
[3] Lindbloom, B. (2011). Delta E (CIE 1994). Retrieved February 24, 2014, from http://brucelindbloom.com/Eqn_DeltaE_CIE94.html Examples
>>> Lab_1 = np.array([100.00000000, 21.57210357, 272.22819350]) >>> Lab_2 = np.array([100.00000000, 426.67945353, 72.39590835]) >>> delta_E_CIE1994(Lab_1, Lab_2) 83.7792255... >>> delta_E_CIE1994(Lab_1, Lab_2, textiles=True) 88.3355530...
-
colour.difference.delta_e.
delta_E_CIE2000
(Lab_1, Lab_2, textiles=False)[source]¶ Returns the difference \(\Delta E_{ab}\) between two given CIE Lab colourspace arrays using CIE 2000 recommendation.
Parameters: - Lab_1 (array_like) – CIE Lab colourspace array 1.
- Lab_2 (array_like) – CIE Lab colourspace array 2.
- textiles (bool, optional) – Textiles application specific parametric factors \(k_L=2,\ k_C=k_H=1\) weights are used instead of \(k_L=k_C=k_H=1\).
Returns: Colour difference \(\Delta E_{ab}\).
Return type: numeric or ndarray
Notes
- CIE 2000 colour differences are not symmetrical: difference between Lab_1 and Lab_2 may not be the same as difference between Lab_2 and Lab_1 thus one colour must be understood to be the reference against which a sample colour is compared.
- Parametric factors \(k_L=k_C=k_H=1\) weights under
- reference conditions: [5]_
- Illumination: D65 source
- Illuminance: 1000 lx
- Observer: Normal colour vision
- Background field: Uniform, neutral gray with \(L^*=50\)
- Viewing mode: Object
- Sample size: Greater than 4 degrees
- Sample separation: Direct edge contact
- Sample colour-difference magnitude: Lower than 5.0 \(\Delta E_{ab}\)
- Sample structure: Homogeneous (without texture)
References
[4] Lindbloom, B. (2009). Delta E (CIE 2000). Retrieved February 24, 2014, from http://brucelindbloom.com/Eqn_DeltaE_CIE2000.html [5] Melgosa, M. (2013). CIE / ISO new standard: CIEDE2000, 2013(July). Retrieved from http://www.color.org/events/colorimetry/Melgosa_CIEDE2000_Workshop-July4.pdf Examples
>>> Lab_1 = np.array([100.00000000, 21.57210357, 272.22819350]) >>> Lab_2 = np.array([100.00000000, 426.67945353, 72.39590835]) >>> delta_E_CIE2000(Lab_1, Lab_2) 94.0356490... >>> Lab_2 = np.array([50.00000000, 426.67945353, 72.39590835]) >>> delta_E_CIE2000(Lab_1, Lab_2) 100.8779470... >>> delta_E_CIE2000(Lab_1, Lab_2, textiles=True) 95.7920535...
-
colour.difference.delta_e.
delta_E_CMC
(Lab_1, Lab_2, l=2, c=1)[source]¶ Returns the difference \(\Delta E_{ab}\) between two given CIE Lab colourspace arrays using Colour Measurement Committee recommendation.
The quasimetric has two parameters: Lightness (l) and chroma (c), allowing the users to weight the difference based on the ratio of l:c. Commonly used values are 2:1 for acceptability and 1:1 for the threshold of imperceptibility.
Parameters: - Lab_1 (array_like) – CIE Lab colourspace array 1.
- Lab_2 (array_like) – CIE Lab colourspace array 2.
- l (numeric, optional) – Lightness weighting factor.
- c (numeric, optional) – Chroma weighting factor.
Returns: Colour difference \(\Delta E_{ab}\).
Return type: numeric or ndarray
References
[5] Lindbloom, B. (2009). Delta E (CMC). Retrieved February 24, 2014, from http://brucelindbloom.com/Eqn_DeltaE_CMC.html Examples
>>> Lab_1 = np.array([100.00000000, 21.57210357, 272.22819350]) >>> Lab_2 = np.array([100.00000000, 426.67945353, 72.39590835]) >>> delta_E_CMC(Lab_1, Lab_2) 172.7047712...
-
colour.difference.delta_e.
DELTA_E_METHODS
= CaseInsensitiveMapping({u'cie1994': <function delta_E_CIE1994 at 0x7f5de099f050>, u'CIE 1994': <function delta_E_CIE1994 at 0x7f5de099f050>, u'cie1976': <function delta_E_CIE1976 at 0x7f5de0a06668>, u'CMC': <function delta_E_CMC at 0x7f5de099f140>, u'CIE 1976': <function delta_E_CIE1976 at 0x7f5de0a06668>, u'cie2000': <function delta_E_CIE2000 at 0x7f5de099f0c8>, u'CIE 2000': <function delta_E_CIE2000 at 0x7f5de099f0c8>})¶ Supported Delta E computations methods.
- DELTA_E_METHODS : CaseInsensitiveMapping
- {‘CIE 1976’, ‘CIE 1994’, ‘CIE 2000’, ‘CMC’}
Aliases:
- ‘cie1976’: ‘CIE 1976’
- ‘cie1994’: ‘CIE 1994’
- ‘cie2000’: ‘CIE 2000’
-
colour.difference.delta_e.
delta_E
(Lab_1, Lab_2, method=u'CMC', **kwargs)[source]¶ Returns the difference \(\Delta E_{ab}\) between two given CIE Lab colourspace arrays using given method.
Parameters: - Lab_1 (array_like) – CIE Lab colourspace array 1.
- Lab_2 (array_like) – CIE Lab colourspace array 2.
- method (unicode, optional) – {‘CMC’, ‘CIE 1976’, ‘CIE 1994’, ‘CIE 2000’}, Computation method.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Colour difference \(\Delta E_{ab}\).
Return type: numeric or ndarray
Examples
>>> Lab_1 = np.array([100.00000000, 21.57210357, 272.22819350]) >>> Lab_2 = np.array([100.00000000, 426.67945353, 72.39590835]) >>> delta_E(Lab_1, Lab_2) 172.7047712... >>> delta_E(Lab_1, Lab_2, method='CIE 1976') 451.7133019... >>> delta_E(Lab_1, Lab_2, method='CIE 1994') 83.7792255... >>> delta_E( ... Lab_1, Lab_2, method='CIE 1994', textiles=False) 83.7792255... >>> delta_E(Lab_1, Lab_2, method='CIE 2000') 94.0356490...