colour.XYZ_to_ZCAM#
- colour.XYZ_to_ZCAM(XYZ: Annotated[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], 1], XYZ_w: Annotated[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], 1], L_A: ArrayLike, Y_b: ArrayLike, surround: InductionFactors_ZCAM = VIEWING_CONDITIONS_ZCAM['Average'], discount_illuminant: bool = False, compute_H: bool = True) Annotated[CAM_Specification_ZCAM, 1, 1, 360, 1, 1, 1, 400, 1, 1, 1][source]#
Compute the ZCAM colour appearance model correlates from the specified CIE XYZ tristimulus values.
- Parameters:
XYZ (Annotated[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], 1]) – Absolute CIE XYZ tristimulus values of test sample / stimulus.
XYZ_w (Annotated[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], 1]) – 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, approximating 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.
compute_H (bool) – Whether to compute Hue \(h\) quadrature \(H\). \(H\) is rarely used, and expensive to compute.
- Returns:
ZCAM colour appearance model specification.
- Return type:
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
XYZUN
UN
XYZ_wUN
UN
Range
Scale - Reference
Scale - 1
specification.JUN
1
specification.CUN
1
specification.h360
1
specification.sUN
1
specification.QUN
1
specification.MUN
1
specification.H400
1
specification.HCUN
1
specification.VUN
1
specification.KUN
1
specification.HUN
1
References
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...)