colour.adaptation.chromatic_adaptation_Zhai2018#

colour.adaptation.chromatic_adaptation_Zhai2018(XYZ_b: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], XYZ_wb: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], XYZ_wd: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], D_b: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] = 1, D_d: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] = 1, XYZ_wo: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] = np.array([1, 1, 1]), transform: Literal['CAT02', 'CAT16'] | str = 'CAT02') ndarray[Any, dtype[float16 | float32 | float64]][source]#

Adapt given sample colour \(XYZ_{\beta}\) tristimulus values from input viewing conditions under \(\beta\) illuminant to output viewing conditions under \(\delta\) illuminant using Zhai and Luo (2018) chromatic adaptation model.

According to the definition of \(D\), a one-step CAT such as CAT02 can only be used to transform colors from an incomplete adapted field into a complete adapted field. When CAT02 are used to transform an incomplete to incomplete case, \(D\) has no baseline level to refer to. Smet et al. (2017) proposed a new concept of two-step CAT to replace the present CATs such as CAT02 with only one-step transform in order to define \(D\) more clearly. A two-step CAT involves an illuminant representing the baseline states between the test and reference illuminants for the calculation. In the first step the test color is transformed from test illuminant to the baseline illuminant (\(BI\)), and it is then transformed to the reference illuminant Degrees of adaptation under the other illuminants should be calculated relative to the adaptation under the \(BI\). When \(D\) becomes lower towards zero, the adaptation point of the observer moves towards the \(BI\). Therefore, the chromaticity of the \(BI\) should be an intrinsic property of the human vision system.

Parameters:
Returns:

Sample corresponding colour \(XYZ_{\delta}\) tristimulus values under output illuminant \(D_{\delta}\).

Return type:

numpy.ndarray

Notes

Domain

Scale - Reference

Scale - 1

XYZ_b

[0, 1]

[0, 1]

XYZ_wb

[0, 1]

[0, 1]

XYZ_wd

[0, 1]

[0, 1]

XYZ_wo

[0, 1]

[0, 1]

Range

Scale - Reference

Scale - 1

XYZ_d

[0, 1]

[0, 1]

References

[ZL18]

Examples

>>> XYZ_b = np.array([48.900, 43.620, 6.250])
>>> XYZ_wb = np.array([109.850, 100, 35.585])
>>> XYZ_wd = np.array([95.047, 100, 108.883])
>>> D_b = 0.9407
>>> D_d = 0.9800
>>> XYZ_wo = np.array([100, 100, 100])
>>> chromatic_adaptation_Zhai2018(
...     XYZ_b, XYZ_wb, XYZ_wd, D_b, D_d, XYZ_wo
... )  
array([ 39.1856164...,  42.1546179...,  19.2367203...])
>>> XYZ_d = np.array([39.18561644, 42.15461798, 19.23672036])
>>> chromatic_adaptation_Zhai2018(
...     XYZ_d, XYZ_wd, XYZ_wb, D_d, D_b, XYZ_wo
... )  
array([ 48.9 ,  43.62,   6.25])