colour.models.hdr_ipt Module¶
hdr-IPT Colourspace¶
Defines the hdr-IPT colourspace transformations:
See also
References
[1] | Fairchild, M. D., & Wyble, D. R. (2010). hdr-CIELAB and hdr-IPT: Simple Models for Describing the Color of High-Dynamic-Range and Wide-Color-Gamut Images. In Proc. of Color and Imaging Conference (pp. 322–326). ISBN:9781629932156 |
-
colour.models.hdr_ipt.
XYZ_to_hdr_IPT
(XYZ, Y_s=0.2, Y_abs=100)[source]¶ Converts from CIE XYZ tristimulus values to hdr-IPT colourspace.
Parameters: - XYZ (array_like) – CIE XYZ tristimulus values.
- Y_s (numeric or array_like) – Relative luminance \(Y_s\) of the surround in domain [0, 1].
- Y_abs (numeric or array_like) – Absolute luminance \(Y_{abs}\) of the scene diffuse white in \(cd/m^2\).
Returns: hdr-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.00000000, 1.12179215]) >>> XYZ_to_hdr_IPT(XYZ) array([ 94.6592917..., 0.3804177..., -0.2673118...])
-
colour.models.hdr_ipt.
hdr_IPT_to_XYZ
(IPT_hdr, Y_s=0.2, Y_abs=100)[source]¶ Converts from hdr-IPT colourspace to CIE XYZ tristimulus values.
Parameters: - IPT_hdr (array_like) – hdr-IPT colourspace array.
- Y_s (numeric or array_like) – Relative luminance \(Y_s\) of the surround in domain [0, 1].
- Y_abs (numeric or array_like) – Absolute luminance \(Y_{abs}\) of the scene diffuse white in \(cd/m^2\).
Returns: CIE XYZ tristimulus values.
Return type: ndarray
Examples
>>> IPT_hdr = np.array([94.65929175, 0.38041773, -0.26731187]) >>> hdr_IPT_to_XYZ(IPT_hdr) array([ 0.9690723..., 1. , 1.1217921...])
-
colour.models.hdr_ipt.
exponent_hdr_IPT
(Y_s, Y_abs)[source]¶ Computes hdr-IPT colourspace Lightness \(\epsilon\) exponent.
Parameters: - Y_s (numeric or array_like) – Relative luminance \(Y_s\) of the surround in range [0, 1].
- Y_abs (numeric or array_like) – Absolute luminance \(Y_{abs}\) of the scene diffuse white in \(cd/m^2\).
Returns: hdr-IPT colourspace Lightness \(\epsilon\) exponent.
Return type: array_like
Examples
>>> exponent_hdr_IPT(0.2, 100) 1.6891383...