colour.CAM16_to_XYZ#
- colour.CAM16_to_XYZ(specification: Annotated[CAM_Specification_CAM16, 100, 100, 360, 100, 100, 100, 400], XYZ_w: Annotated[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], 100], L_A: ArrayLike, Y_b: ArrayLike, surround: InductionFactors_CIECAM02 | InductionFactors_CAM16 = VIEWING_CONDITIONS_CAM16['Average'], discount_illuminant: bool = False) Annotated[ndarray[tuple[Any, ...], dtype[float16 | float32 | float64]], 100][source]#
Convert the CAM16 colour appearance model specification to CIE XYZ tristimulus values.
- Parameters:
specification (Annotated[CAM_Specification_CAM16, (100, 100, 360, 100, 100, 100, 400)]) – 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 (Annotated[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], 100]) – CIE XYZ tristimulus values of reference white.
L_A (ArrayLike) – 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 (ArrayLike) – Luminous factor of background \(Y_b\) such as \(Y_b = 100 \times 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, approximating an \(L^*\) of 50 is used.
surround (InductionFactors_CIECAM02 | InductionFactors_CAM16) – Surround viewing conditions induction factors.
discount_illuminant (bool) – Truth value indicating if the illuminant should be discounted.
- Returns:
CIE XYZ tristimulus values.
- Return type:
- Raises:
ValueError – If neither \(C\) nor \(M\) correlates have been defined in the
specificationargument.
Notes
Domain
Scale - Reference
Scale - 1
specification.J100
1
specification.C100
1
specification.h360
1
specification.s100
1
specification.Q100
1
specification.M100
1
specification.H360
1
XYZ_w100
1
Range
Scale - Reference
Scale - 1
XYZ100
1
References
[LLW+17]
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...])