colour.XYZ_to_ICtCp

colour.XYZ_to_ICtCp(XYZ, illuminant=array([0.3127, 0.329]), chromatic_adaptation_transform='CAT02', method='Dolby 2016', L_p=10000)[source]

Converts from CIE XYZ tristimulus values to \(IC_TC_P\) colour encoding.

Parameters
  • XYZ (array_like) – CIE XYZ tristimulus values.

  • illuminant (array_like, optional) – Source illuminant chromaticity coordinates.

  • chromatic_adaptation_transform (str, optional) – {‘CAT02’, ‘XYZ Scaling’, ‘Von Kries’, ‘Bradford’, ‘Sharp’, ‘Fairchild’, ‘CMCCAT97’, ‘CMCCAT2000’, ‘CAT02 Brill 2008’, ‘CAT16’, ‘Bianco 2010’, ‘Bianco PC 2010’}, Chromatic adaptation transform.

  • method (str, optional) –

    {‘Dolby 2016’, ‘ITU-R BT.2100-1 HLG’, ‘ITU-R BT.2100-1 PQ’, ‘ITU-R BT.2100-2 HLG’, ‘ITU-R BT.2100-2 PQ’}, Computation method. Recommendation ITU-R BT.2100 defines multiple variants of the \(IC_TC_P\) colour encoding:

    • ITU-R BT.2100-1

      • SMPTE ST 2084:2014 inverse electro-optical transfer function (EOTF / EOCF) and the \(IC_TC_P\) matrix from [Dolby16]: Dolby 2016, ITU-R BT.2100-1 PQ, ITU-R BT.2100-2 PQ methods.

      • Recommendation ITU-R BT.2100 Reference HLG opto-electrical transfer function (OETF / OECF) and the \(IC_TC_P\) matrix from [Dolby16]: ITU-R BT.2100-1 HLG method.

    • ITU-R BT.2100-2

      • SMPTE ST 2084:2014 inverse electro-optical transfer function (EOTF / EOCF) and the \(IC_TC_P\) matrix from [Dolby16]: Dolby 2016, ITU-R BT.2100-1 PQ, ITU-R BT.2100-2 PQ methods.

      • Recommendation ITU-R BT.2100 Reference HLG opto-electrical transfer function (OETF / OECF) and a custom \(IC_TC_P\) matrix from [InternationalTUnion18]: ITU-R BT.2100-2 HLG method.

  • L_p (numeric, optional) – Display peak luminance \(cd/m^2\) for SMPTE ST 2084:2014 non-linear encoding. This parameter should stay at its default \(10000 cd/m^2\) value for practical applications. It is exposed so that the definition can be used as a fitting function.

Returns

\(IC_TC_P\) colour encoding array.

Return type

ndarray

Warning

The underlying SMPTE ST 2084:2014 transfer function is an absolute transfer function.

Notes

  • The underlying SMPTE ST 2084:2014 transfer function is an absolute transfer function, thus the domain and range values for the Reference

  • The ITU-R BT.2100-1 PQ and ITU-R BT.2100-2 PQ methods are aliases for the Dolby 2016 method. and 1 scales are only indicative that the data is not affected by scale transformations. The effective domain of SMPTE ST 2084:2014 inverse electro-optical transfer function (EOTF / EOCF) is [0.0001, 10000].

Domain

Scale - Reference

Scale - 1

XYZ

UN

UN

Range

Scale - Reference

Scale - 1

ICtCp

I : [0, 1]

CT : [-1, 1]

CP : [-1, 1]

I : [0, 1]

CT : [-1, 1]

CP : [-1, 1]

References

[Dolby16], [LPY+16]

Examples

>>> XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
>>> XYZ_to_ICtCp(XYZ)  
array([ 0.0685809..., -0.0028384...,  0.0602098...])
>>> XYZ_to_ICtCp(XYZ, method='ITU-R BT.2100-2 HLG')  
array([ 0.5924279..., -0.0374073...,  0.2512267...])