colour.XYZ_to_CIECAM02

colour.XYZ_to_CIECAM02(XYZ, XYZ_w, L_A, Y_b, surround=CIECAM02_InductionFactors(F=1, c=0.69, N_c=1), discount_illuminant=False)[source]

Computes the CIECAM02 colour appearance model correlates from given CIE XYZ tristimulus values.

This is the forward implementation.

Parameters:
  • XYZ (array_like) – CIE XYZ tristimulus values of test sample / stimulus.
  • 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) – Relative luminance of background \(Y_b\) in \(cd/m^2\).
  • surround (CIECAM02_InductionFactors, optional) – Surround viewing conditions induction factors.
  • discount_illuminant (bool, optional) – Truth value indicating if the illuminant should be discounted.
Returns:

CIECAM02 colour appearance model specification.

Return type:

CIECAM02_Specification

Notes

Domain Scale - Reference Scale - 1
XYZ [0, 100] [0, 1]
XYZ_w [0, 100] [0, 1]
Range Scale - Reference Scale - 1
CIECAM02_specification.h [0, 360] [0, 1]
CIECAM02_specification.H [0, 360] [0, 1]

References

[Fai04], [LL13], [MFH+02], [Wik07b]

Examples

>>> XYZ = np.array([19.01, 20.00, 21.78])
>>> XYZ_w = np.array([95.05, 100.00, 108.88])
>>> L_A = 318.31
>>> Y_b = 20.0
>>> surround = CIECAM02_VIEWING_CONDITIONS['Average']
>>> XYZ_to_CIECAM02(XYZ, XYZ_w, L_A, Y_b, surround)  # doctest: +ELLIPSIS
CIECAM02_Specification(J=41.7310911..., C=0.1047077..., h=219.0484326..., s=2.3603053..., Q=195.3713259..., M=0.1088421..., H=278.0607358..., HC=None)