colour.CAM16_to_XYZ¶
- colour.CAM16_to_XYZ(specification, XYZ_w, L_A, Y_b, surround=InductionFactors_CIECAM02(F=1, c=0.69, N_c=1), discount_illuminant=False)[source]¶
Converts from CAM16 specification to CIE XYZ tristimulus values.
This is the inverse implementation.
- Parameters
specification (CAM_Specification_CAM16) – CAM16 colour appearance model specification. Correlate of Lightness \(J\), correlate of chroma \(C\) or correlate of colourfulness \(M\) and hue angle \(h\) in degrees must be specified, e.g. \(JCh\) or \(JMh\).
XYZ_w (array_like) – CIE XYZ tristimulus values of reference white.
L_A (numeric or array_like) – Adapting field luminance \(L_A\) in \(cd/m^2\), (often taken to be 20% of the luminance of a white object in the scene).
Y_b (numeric or array_like) – Luminous factor of background \(Y_b\) such as \(Y_b = 100 x L_b / L_w\) where \(L_w\) is the luminance of the light source and \(L_b\) is the luminance of the background. For viewing images, \(Y_b\) can be the average \(Y\) value for the pixels in the entire image, or frequently, a \(Y\) value of 20, approximate an \(L^*\) of 50 is used.
surround (InductionFactors_CAM16, optional) – Surround viewing conditions.
discount_illuminant (bool, optional) – Discount the illuminant.
- Returns
XYZ – CIE XYZ tristimulus values.
- Return type
ndarray
- Raises
ValueError – If neither C or M correlates have been defined in the
CAM_Specification_CAM16
argument.
Notes
Domain
Scale - Reference
Scale - 1
CAM_Specification_CAM16.J
[0, 100]
[0, 1]
CAM_Specification_CAM16.C
[0, 100]
[0, 1]
CAM_Specification_CAM16.h
[0, 360]
[0, 1]
CAM_Specification_CAM16.s
[0, 100]
[0, 1]
CAM_Specification_CAM16.Q
[0, 100]
[0, 1]
CAM_Specification_CAM16.M
[0, 100]
[0, 1]
CAM_Specification_CAM16.H
[0, 360]
[0, 1]
XYZ_w
[0, 100]
[0, 1]
Range
Scale - Reference
Scale - 1
XYZ
[0, 100]
[0, 1]
CAM_Specification_CAM16
can also be passed as a compatible argument tocolour.utilities.as_namedtuple()
definition.
References
[]
Examples
>>> specification = CAM_Specification_CAM16(J=41.731207905126638, ... C=0.103355738709070, ... h=217.067959767393010) >>> XYZ_w = np.array([95.05, 100.00, 108.88]) >>> L_A = 318.31 >>> Y_b = 20.0 >>> CAM16_to_XYZ(specification, XYZ_w, L_A, Y_b) array([ 19.01..., 20... , 21.78...])