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 colourspace to cone responses matrix.
CIE1994_XYZ_TO_RGB_MATRIX : array_like, (3, 3)
CIE 1994 colour appearance model cone responses to CIE XYZ colourspace matrix.
CIE1994_RGB_TO_XYZ_MATRIX : array_like, (3, 3)
Adapts given CIE XYZ_1 colourspace stimulus from test viewing conditions to reference viewing conditions using CIE 1994 chromatic adaptation model.
Parameters: |
|
---|---|
Returns: | Adapted CIE XYZ_2 colourspace test stimulus. |
Return type: | ndarray, (3,) |
Warning
The input domain of that definition is non standard!
Notes
Examples
>>> XYZ_1 = np.array([28.0, 21.26, 5.27])
>>> xy_o1 = (0.4476, 0.4074)
>>> xy_o2 = (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 colourspace to cone responses.
Parameters: | XYZ (array_like, (3,)) – CIE XYZ colourspace matrix. |
---|---|
Returns: | Cone responses. |
Return type: | ndarray, (3,) |
Examples
>>> XYZ = np.array([28.0, 21.26, 5.27])
>>> XYZ_to_RGB_cie1994(XYZ)
array([ 25.8244273..., 18.6791422..., 4.8390194...])
Converts from cone responses to CIE XYZ colourspace.
Parameters: | RGB (array_like, (3,)) – Cone responses. |
---|---|
Returns: | CIE XYZ colourspace matrix. |
Return type: | ndarray, (3,) |
Examples
>>> RGB = np.array([25.8244273, 18.6791422, 4.8390194])
>>> RGB_to_XYZ_cie1994(RGB)
array([ 28. , 21.26, 5.27])
Returns the intermediate values \(\xi\), \(\eta\), \(\zeta\).
Parameters: | xy_o (array_like, (2,)) – Chromaticity coordinates \(x_o\) and \(y_o\) of whitepoint. |
---|---|
Returns: | Intermediate values \(\xi\), \(\eta\), \(\zeta\). |
Return type: | ndarray, (3,) |
Examples
>>> xy_o = (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, (3,) |
Examples
>>> Y_o = 20
>>> E_o = 1000
>>> xez = np.array([1.11857195, 0.9329553, 0.32680879])
>>> effective_adapting_responses(Y_o, E_o, xez)
array([ 71.2105020..., 59.3937790..., 20.8052937...])
Computes the exponent \(\beta_1\) for the middle and long-wavelength sensitive cones.
Parameters: | x (numeric) – Middle and long-wavelength sensitive cone response. |
---|---|
Returns: | Exponent \(\beta_1\). |
Return type: | numeric |
Examples
>>> beta_1(318.323316315)
4.6106222...
Computes the exponent \(\beta_2\) for the short-wavelength sensitive cones.
Parameters: | x (numeric) – Short-wavelength sensitive cone response. |
---|---|
Returns: | Exponent \(\beta_2\). |
Return type: | numeric |
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 (ndarray, (3,)) – Cone responses. |
---|---|
Returns: | Chromatic adaptation exponential factors \(\beta_1(R_o)\), \(\beta_1(G_o)\) and \(\beta_2(B_o)\). |
Return type: | ndarray, (3,) |
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 |
Examples
>>> Y_o = 20
>>> xez_1 = np.array([1.11857195, 0.9329553, 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])
>>> K_coefficient(Y_o, xez_1, xez_2, bRGB_o1, bRGB_o2)
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, (3,) |
Examples
>>> RGB_1 = np.array([25.8244273, 18.6791422, 4.8390194])
>>> Y_o = 20
>>> xez_1 = np.array([1.11857195, 0.9329553, 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])
>>> K = 1.0
>>> corresponding_colour(RGB_1, Y_o, xez_1, xez_2, bRGB_o1, bRGB_o2, K)
array([ 23.1636901..., 20.0211948..., 16.2001664...])