colour.models.ipt Module

IPT Colourspace

Defines the IPT colourspace transformations:

And computation of correlates:

References

[1]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 tristimulus values 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 tristimulus values 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 tristimulus values to IPT colourspace.

Parameters:XYZ (array_like) – CIE XYZ tristimulus values.
Returns:IPT colourspace array.
Return type:ndarray

Notes

  • Input CIE XYZ tristimulus values 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 tristimulus values.

Parameters:IPT (array_like) – IPT colourspace array.
Returns:CIE XYZ tristimulus values.
Return type:ndarray

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.

Parameters:IPT (array_like) – IPT colourspace array.
Returns:Hue angle.
Return type:numeric or ndarray

Examples

>>> IPT = np.array([0.96907232, 1, 1.12179215])
>>> IPT_hue_angle(IPT)  
0.8427358...