# colour.XYZ_to_ZCAM#

colour.XYZ_to_ZCAM(XYZ: ArrayLike, XYZ_w: ArrayLike, L_A: ArrayLike, Y_b: ArrayLike, surround: InductionFactors_ZCAM = VIEWING_CONDITIONS_ZCAM['Average'], discount_illuminant: bool = False) [source]#

Compute the ZCAM colour appearance model correlates from given CIE XYZ tristimulus values.

Parameters:
• XYZ (ArrayLike) – Absolute CIE XYZ tristimulus values of test sample / stimulus.

• XYZ_w (ArrayLike) – Absolute CIE XYZ tristimulus values of the white under reference illuminant.

• L_A (ArrayLike) – Test adapting field luminance $$L_A$$ in $$cd/m^2$$ such as $$L_A = L_w * Y_b / 100$$ (where $$L_w$$ is luminance of the reference white and $$Y_b$$ is the background luminance factor).

• Y_b (ArrayLike) – Luminous factor of background $$Y_b$$ such as $$Y_b = 100 * 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_ZCAM) – Surround viewing conditions induction factors.

• discount_illuminant (bool) – Truth value indicating if the illuminant should be discounted.

Returns:

ZCAM colour appearance model specification.

Return type:

colour.CAM_Specification_ZCAM

Warning

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

Notes

• Safdar, Hardeberg and Luo (2021) does not specify how the chromatic adaptation to CIE Standard Illuminant D65 in Step 0 should be performed. A one-step Von Kries chromatic adaptation transform is not symmetrical or transitive when a degree of adaptation is involved. Safdar, Hardeberg and Luo (2018) uses Zhai and Luo (2018) two-steps chromatic adaptation transform, thus it seems sensible to adopt this transform for the ZCAM colour appearance model until more information is available. It is worth noting that a one-step Von Kries chromatic adaptation transform with support for degree of adaptation produces values closer to the supplemental document compared to the Zhai and Luo (2018) two-steps chromatic adaptation transform but then the ZCAM colour appearance model does not round-trip properly.

• The underlying SMPTE ST 2084:2014 transfer function is an absolute transfer function, thus the domain and range values for the Reference and 1 scales are only indicative that the data is not affected by scale transformations.

Domain

Scale - Reference

Scale - 1

XYZ

[UN]

[UN]

XYZ_tw

[UN]

[UN]

XYZ_rw

[UN]

[UN]

Range

Scale - Reference

Scale - 1

CAM_Specification_ZCAM.J

[UN]

[0, 1]

CAM_Specification_ZCAM.C

[UN]

[0, 1]

CAM_Specification_ZCAM.h

[0, 360]

[0, 1]

CAM_Specification_ZCAM.s

[UN]

[0, 1]

CAM_Specification_ZCAM.Q

[UN]

[0, 1]

CAM_Specification_ZCAM.M

[UN]

[0, 1]

CAM_Specification_ZCAM.H

[0, 400]

[0, 1]

CAM_Specification_ZCAM.HC

[UN]

[0, 1]

CAM_Specification_ZCAM.V

[UN]

[0, 1]

CAM_Specification_ZCAM.K

[UN]

[0, 1]

CAM_Specification_ZCAM.H

[UN]

[0, 1]

References

[SHKL18], [SHRL21], [ZL18]

Examples

>>> XYZ = np.array([185, 206, 163])
>>> XYZ_w = np.array([256, 264, 202])
>>> L_A = 264
>>> Y_b = 100
>>> surround = VIEWING_CONDITIONS_ZCAM["Average"]
>>> XYZ_to_ZCAM(XYZ, XYZ_w, L_A, Y_b, surround)
...
CAM_Specification_ZCAM(J=92.2504437..., C=3.0216926..., h=196.3245737..., s=19.1319556..., Q=321.3408463..., M=10.5256217..., H=237.6114442..., HC=None, V=34.7006776..., K=25.8835968..., W=91.6821728...)