colour.adaptation.cmccat2000 Module

CMCCAT2000 Chromatic Adaptation Model

Defines CMCCAT2000 chromatic adaptation model objects:

References

[1]Li, C., Luo, M. R., Rigg, B., & Hunt, R. W. G. (2002). CMC 2000 chromatic adaptation transform: CMCCAT2000. Color Research & …, 27(1), 49–58. doi:10.1002/col.10005
[2]Westland, S., Ripamonti, C., & Cheung, V. (2012). CMCCAT2000. In Computational Colour Science Using MATLAB (2nd ed., pp. 83–86). ISBN:978-0-470-66569-5
colour.adaptation.cmccat2000.CMCCAT2000_INVERSE_CAT = array([[ 1.07645005, -0.23766239, 0.16121234], [ 0.41096433, 0.5543418 , 0.03469387], [-0.01095377, -0.01338936, 1.02434312]])

Inverse CMCCAT2000_CAT chromatic adaptation transform.

CMCCAT2000_INVERSE_CAT : array_like, (3, 3)

class colour.adaptation.cmccat2000.CMCCAT2000_InductionFactors[source]

Bases: colour.adaptation.cmccat2000.CMCCAT2000_InductionFactors

CMCCAT2000 chromatic adaptation model induction factors.

Parameters:F (numeric or array_like) – \(F\) surround condition.
colour.adaptation.cmccat2000.CMCCAT2000_VIEWING_CONDITIONS = CaseInsensitiveMapping({u'Dark': CMCCAT2000_InductionFactors(F=0.8), u'Dim': CMCCAT2000_InductionFactors(F=0.8), u'Average': CMCCAT2000_InductionFactors(F=1.0)})

Reference CMCCAT2000 chromatic adaptation model viewing conditions.

CMCCAT2000_VIEWING_CONDITIONS : CaseInsensitiveMapping
(‘Average’, ‘Dim’, ‘Dark’)
colour.adaptation.cmccat2000.CMCCAT2000_forward(XYZ, XYZ_w, XYZ_wr, L_A1, L_A2, surround=CMCCAT2000_InductionFactors(F=1.0))[source]

Adapts given stimulus CIE XYZ tristimulus values from test viewing conditions to reference viewing conditions using CMCCAT2000 forward chromatic adaptation model.

Parameters:
  • XYZ (array_like) – CIE XYZ tristimulus values of the stimulus to adapt.
  • XYZ_w (array_like) – Test viewing condition CIE XYZ tristimulus values of the whitepoint.
  • XYZ_wr (array_like) – Reference viewing condition CIE XYZ tristimulus values of the whitepoint.
  • L_A1 (numeric or array_like) – Luminance of test adapting field \(L_{A1}\) in \(cd/m^2\).
  • L_A2 (numeric or array_like) – Luminance of reference adapting field \(L_{A2}\) in \(cd/m^2\).
  • surround (CMCCAT2000_InductionFactors, optional) – Surround viewing conditions induction factors.
Returns:

CIE XYZ_c tristimulus values of the stimulus corresponding colour.

Return type:

ndarray

Warning

The input and output domains of that definition are non standard!

Notes

  • Input CIE XYZ, CIE XYZ_w and CIE XYZ_wr tristimulus values are in domain [0, 100].
  • Output CIE XYZ_c tristimulus values are in domain [0, 100].

Examples

>>> XYZ = np.array([22.48, 22.74, 8.54])
>>> XYZ_w = np.array([111.15, 100.00, 35.20])
>>> XYZ_wr = np.array([94.81, 100.00, 107.30])
>>> L_A1 = 200
>>> L_A2 = 200
>>> CMCCAT2000_forward(  
...     XYZ, XYZ_w, XYZ_wr, L_A1, L_A2)
array([ 19.5269832...,  23.0683396...,  24.9717522...])
colour.adaptation.cmccat2000.CMCCAT2000_reverse(XYZ_c, XYZ_w, XYZ_wr, L_A1, L_A2, surround=CMCCAT2000_InductionFactors(F=1.0))[source]

Adapts given stimulus corresponding colour CIE XYZ tristimulus values from reference viewing conditions to test viewing conditions using CMCCAT2000 reverse chromatic adaptation model.

Parameters:
  • XYZ (array_like) – CIE XYZ tristimulus values of the stimulus to adapt.
  • XYZ_w (array_like) – Test viewing condition CIE XYZ tristimulus values of the whitepoint.
  • XYZ_wr (array_like) – Reference viewing condition CIE XYZ tristimulus values of the whitepoint.
  • L_A1 (numeric or array_like) – Luminance of test adapting field \(L_{A1}\) in \(cd/m^2\).
  • L_A2 (numeric or array_like) – Luminance of reference adapting field \(L_{A2}\) in \(cd/m^2\).
  • surround (CMCCAT2000_InductionFactors, optional) – Surround viewing conditions induction factors.
Returns:

CIE XYZ_c tristimulus values of the adapted stimulus.

Return type:

ndarray

Warning

The input and output domains of that definition are non standard!

Notes

  • Input CIE XYZ_c, CIE XYZ_w and CIE XYZ_wr tristimulus values are in domain [0, 100].
  • Output CIE XYZ tristimulus values are in domain [0, 100].

Examples

>>> XYZ_c = np.array([19.53, 23.07, 24.97])
>>> XYZ_w = np.array([111.15, 100.00, 35.20])
>>> XYZ_wr = np.array([94.81, 100.00, 107.30])
>>> L_A1 = 200
>>> L_A2 = 200
>>> CMCCAT2000_reverse(  
...     XYZ_c, XYZ_w, XYZ_wr, L_A1, L_A2)
array([ 22.4839876...,  22.7419485...,   8.5393392...])
colour.adaptation.cmccat2000.chromatic_adaptation_CMCCAT2000(XYZ, XYZ_w, XYZ_wr, L_A1, L_A2, surround=CMCCAT2000_InductionFactors(F=1.0), method=u'Forward')[source]

Adapts given stimulus CIE XYZ tristimulus values using given viewing conditions.

This definition is a convenient wrapper around CMCCAT2000_forward() and CMCCAT2000_reverse().

Parameters:
  • XYZ (array_like) – CIE XYZ tristimulus values of the stimulus to adapt.
  • XYZ_w (array_like) – Source viewing condition CIE XYZ tristimulus values of the whitepoint.
  • XYZ_wr (array_like) – Target viewing condition CIE XYZ tristimulus values of the whitepoint.
  • L_A1 (numeric or array_like) – Luminance of test adapting field \(L_{A1}\) in \(cd/m^2\).
  • L_A2 (numeric or array_like) – Luminance of reference adapting field \(L_{A2}\) in \(cd/m^2\).
  • surround (CMCCAT2000_InductionFactors, optional) – Surround viewing conditions induction factors.
  • method (unicode, optional) – {‘Forward’, ‘Reverse’}, Chromatic adaptation method.
Returns:

Adapted stimulus CIE XYZ tristimulus values.

Return type:

ndarray

Warning

The input and output domains of that definition are non standard!

Notes

  • Input CIE XYZ, CIE XYZ_w and CIE XYZ_wr tristimulus values are in domain [0, 100].
  • Output CIE XYZ tristimulus values are in domain [0, 100].

Examples

>>> XYZ = np.array([22.48, 22.74, 8.54])
>>> XYZ_w = np.array([111.15, 100.00, 35.20])
>>> XYZ_wr = np.array([94.81, 100.00, 107.30])
>>> L_A1 = 200
>>> L_A2 = 200
>>> chromatic_adaptation_CMCCAT2000(  
...     XYZ, XYZ_w, XYZ_wr, L_A1, L_A2, method='Forward')
array([ 19.5269832...,  23.0683396...,  24.9717522...])

Using the CMCCAT2000 reverse model:

>>> XYZ = np.array([19.52698326, 23.06833960, 24.97175229])
>>> XYZ_w = np.array([111.15, 100.00, 35.20])
>>> XYZ_wr = np.array([94.81, 100.00, 107.30])
>>> L_A1 = 200
>>> L_A2 = 200
>>> chromatic_adaptation_CMCCAT2000(  
...     XYZ, XYZ_w, XYZ_wr, L_A1, L_A2, method='Reverse')
array([ 22.48,  22.74,   8.54])