Defines CIE 1994 chromatic adaptation model objects:
References
[1] | CIE TC 1-32. (1994). CIE 109-1994 A Method of Predicting Corresponding Colours under Different Chromatic and Illuminance Adaptations (pp. 1–18). ISBN:978-3-900734-51-0 |
CIE 1994 colour appearance model CIE XYZ tristimulus values to cone responses matrix.
CIE1994_XYZ_TO_RGB_MATRIX : array_like, (3, 3)
CIE 1994 colour appearance model cone responses to CIE XYZ tristimulus values matrix.
CIE1994_RGB_TO_XYZ_MATRIX : array_like, (3, 3)
Adapts given stimulus CIE XYZ_1 tristimulus values from test viewing conditions to reference viewing conditions using CIE 1994 chromatic adaptation model.
Parameters: |
|
---|---|
Returns: | Adapted CIE XYZ_2 tristimulus values of test stimulus. |
Return type: | ndarray |
Warning
The input domain of that definition is non standard!
Notes
Examples
>>> XYZ_1 = np.array([28.00, 21.26, 5.27])
>>> xy_o1 = np.array([0.4476, 0.4074])
>>> xy_o2 = np.array([0.3127, 0.3290])
>>> Y_o = 20
>>> E_o1 = 1000
>>> E_o2 = 1000
>>> chromatic_adaptation_CIE1994(
... XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2)
array([ 24.0337952..., 21.1562121..., 17.6430119...])
Converts from CIE XYZ tristimulus values to cone responses.
Parameters: | XYZ (array_like) – CIE XYZ tristimulus values. |
---|---|
Returns: | Cone responses. |
Return type: | ndarray |
Examples
>>> XYZ = np.array([28.00, 21.26, 5.27])
>>> XYZ_to_RGB_cie1994(XYZ)
array([ 25.8244273..., 18.6791422..., 4.8390194...])
Converts from cone responses to CIE XYZ tristimulus values.
Parameters: | RGB (array_like) – Cone responses. |
---|---|
Returns: | CIE XYZ tristimulus values. |
Return type: | ndarray |
Examples
>>> RGB = np.array([25.82442730, 18.67914220, 4.83901940])
>>> RGB_to_XYZ_cie1994(RGB)
array([ 28. , 21.26, 5.27])
Returns the intermediate values \(\xi\), \(\eta\), \(\zeta\).
Parameters: | xy_o (array_like) – Chromaticity coordinates \(x_o\) and \(y_o\) of whitepoint. |
---|---|
Returns: | Intermediate values \(\xi\), \(\eta\), \(\zeta\). |
Return type: | ndarray |
Examples
>>> xy_o = np.array([0.4476, 0.4074])
>>> intermediate_values(xy_o)
array([ 1.1185719..., 0.9329553..., 0.3268087...])
Derives the effective adapting responses in the fundamental primary system of the test or reference field.
Parameters: |
|
---|---|
Returns: | Effective adapting responses. |
Return type: | ndarray |
Examples
>>> xez = np.array([1.11857195, 0.93295530, 0.32680879])
>>> E_o = 1000
>>> Y_o = 20
>>> effective_adapting_responses(xez, Y_o, E_o)
array([ 71.2105020..., 59.3937790..., 20.8052937...])
Computes the exponent \(\beta_1\) for the middle and long-wavelength sensitive cones.
Parameters: | x (numeric or array_like) – Middle and long-wavelength sensitive cone response. |
---|---|
Returns: | Exponent \(\beta_1\). |
Return type: | numeric or array_like |
Examples
>>> beta_1(318.323316315)
4.6106222...
Computes the exponent \(\beta_2\) for the short-wavelength sensitive cones.
Parameters: | x (numeric or array_like) – Short-wavelength sensitive cone response. |
---|---|
Returns: | Exponent \(\beta_2\). |
Return type: | numeric or array_like |
Examples
>>> beta_2(318.323316315)
4.6522416...
Returns the chromatic adaptation exponential factors \(\beta_1(R_o)\), \(\beta_1(G_o)\) and \(\beta_2(B_o)\) of given cone responses.
Parameters: | RGB_o (array_like) – Cone responses. |
---|---|
Returns: | Chromatic adaptation exponential factors \(\beta_1(R_o)\), \(\beta_1(G_o)\) and \(\beta_2(B_o)\). |
Return type: | ndarray |
Examples
>>> RGB_o = np.array([318.32331631, 318.30352317, 318.23283482])
>>> exponential_factors(RGB_o)
array([ 4.6106222..., 4.6105892..., 4.6520698...])
Computes the coefficient \(K\) for correcting the difference between the test and references illuminances.
Parameters: |
|
---|---|
Returns: | Coefficient \(K\). |
Return type: | numeric or array_like |
Examples
>>> xez_1 = np.array([1.11857195, 0.93295530, 0.32680879])
>>> xez_2 = np.array([1.00000372, 1.00000176, 0.99999461])
>>> bRGB_o1 = np.array([3.74852518, 3.63920879, 2.78924811])
>>> bRGB_o2 = np.array([3.68102374, 3.68102256, 3.56557351])
>>> Y_o = 20
>>> K_coefficient(xez_1, xez_2, bRGB_o1, bRGB_o2, Y_o)
1.0
Computes the corresponding colour cone responses of given test sample cone responses \(RGB_1\).
Parameters: |
|
---|---|
Returns: | Corresponding colour cone responses of given test sample cone responses. |
Return type: | ndarray |
Examples
>>> RGB_1 = np.array([25.82442730, 18.67914220, 4.83901940])
>>> xez_1 = np.array([1.11857195, 0.93295530, 0.32680879])
>>> xez_2 = np.array([1.00000372, 1.00000176, 0.99999461])
>>> bRGB_o1 = np.array([3.74852518, 3.63920879, 2.78924811])
>>> bRGB_o2 = np.array([3.68102374, 3.68102256, 3.56557351])
>>> Y_o = 20
>>> K = 1.0
>>> corresponding_colour(
... RGB_1, xez_1, xez_2, bRGB_o1, bRGB_o2, Y_o, K)
array([ 23.1636901..., 20.0211948..., 16.2001664...])