colour.models.ipt Module

IPT Colourspace

Defines the IPT colourspace transformations:

And computation of correlates:

References

[1](1, 2, 3) Fairchild, M. D. (2013). IPT Colourspace. In Color Appearance Models (3rd ed., pp. 8492–8567). Wiley. ISBN:B00DAYO8E2
colour.models.ipt.IPT_XYZ_TO_LMS_MATRIX = array([[ 0.4002, 0.7075, -0.0807], [-0.228 , 1.15 , 0.0612], [ 0. , 0. , 0.9184]])

CIE XYZ colourspace to IPT colourspace normalised cone responses matrix.

IPT_XYZ_TO_LMS_MATRIX : array_like, (3, 3)

colour.models.ipt.IPT_LMS_TO_XYZ_MATRIX = array([[ 1.85024294, -1.13830164, 0.23843496], [ 0.36683078, 0.64388454, -0.01067344], [ 0. , 0. , 1.08885017]])

IPT colourspace normalised cone responses to CIE XYZ colourspace matrix.

IPT_LMS_TO_XYZ_MATRIX : array_like, (3, 3)

colour.models.ipt.IPT_LMS_TO_IPT_MATRIX = array([[ 0.4 , 0.4 , 0.2 ], [ 4.455 , -4.851 , 0.396 ], [ 0.8056, 0.3572, -1.1628]])

IPT colourspace normalised cone responses to IPT colourspace matrix.

IPT_LMS_TO_IPT_MATRIX : array_like, (3, 3)

colour.models.ipt.IPT_IPT_TO_LMS_MATRIX = array([[ 1. , 0.09756893, 0.20522643], [ 1. , -0.11387649, 0.13321716], [ 1. , 0.03261511, -0.67688718]])

IPT colourspace to IPT colourspace normalised cone responses matrix.

IPT_IPT_TO_LMS_MATRIX : array_like, (3, 3)

colour.models.ipt.XYZ_to_IPT(XYZ)[source]

Converts from CIE XYZ colourspace to IPT colourspace. [1]

Parameters:XYZ (array_like, (3,)) – CIE XYZ colourspace matrix.
Returns:IPT colourspace matrix.
Return type:ndarray, (3,)

Notes

  • Input CIE XYZ colourspace matrix needs to be adapted for CIE Standard Illuminant D Series D65.

Examples

>>> XYZ = np.array([0.96907232, 1, 1.12179215])
>>> XYZ_to_IPT(XYZ)  
array([ 1.0030082...,  0.0190691..., -0.0136929...])
colour.models.ipt.IPT_to_XYZ(IPT)[source]

Converts from IPT colourspace to CIE XYZ colourspace. [1]

Parameters:IPT (array_like, (3,)) – IPT colourspace matrix.
Returns:CIE XYZ colourspace matrix.
Return type:ndarray, (3,)

Examples

>>> IPT = np.array([1.00300825, 0.01906918, -0.01369292])
>>> IPT_to_XYZ(IPT)  
array([ 0.9690723...,  1.        ,  1.1217921...])
colour.models.ipt.IPT_hue_angle(IPT)[source]

Computes the hue angle from IPT colourspace. [1]

Parameters:IPT (array_like, (3,)) – IPT colourspace matrix.
Returns:Hue angle.
Return type:numeric

Examples

>>> IPT_hue_angle(([0.96907232, 1, 1.12179215]))  
0.8427358...