Defines Nayatani (1995) colour appearance model objects:
References
[1] | Fairchild, M. D. (2013). The Nayatani et al. Model. In Color Appearance Models (3rd ed., pp. 4810–5085). Wiley. ASIN:B00DAYO8E2 |
[2] | Nayatani, Y., Sobagaki, H., & Yano, K. H. T. (1995). Lightness dependency of chroma scales of a nonlinear color-appearance model and its latest formulation. Color Research & Application, 20(3), 156–167. doi:10.1002/col.5080200305 |
Nayatani (1995) colour appearance model CIE XYZ tristimulus values to cone responses matrix.
NAYATANI95_XYZ_TO_RGB_MATRIX : array_like, (3, 3)
Bases: colour.appearance.nayatani95.Nayatani95_ReferenceSpecification
Defines the Nayatani (1995) colour appearance model reference specification.
This specification has field names consistent with Fairchild (2013) reference.
Parameters: |
|
---|
Bases: colour.appearance.nayatani95.Nayatani95_Specification
Defines the Nayatani (1995) colour appearance model specification.
This specification has field names consistent with the remaining colour appearance models in colour.appearance but diverge from Fairchild (2013) reference.
Parameters: |
|
---|
Computes the Nayatani (1995) colour appearance model correlates.
Parameters: |
|
---|---|
Returns: | Nayatani (1995) colour appearance model specification. |
Return type: | Nayatani95_Specification |
Warning
The input domain of that definition is non standard!
Notes
Examples
>>> XYZ = np.array([19.01, 20.00, 21.78])
>>> XYZ_n = np.array([95.05, 100.00, 108.88])
>>> Y_o = 20.0
>>> E_o = 5000.0
>>> E_or = 1000.0
>>> XYZ_to_Nayatani95(XYZ, XYZ_n, Y_o, E_o, E_or)
Nayatani95_Specification(Lstar_P=49.9998829..., C=0.0133550..., h=257.5232268..., s=0.0133550..., Q=62.6266734..., M=0.0167262..., H=None, HC=None, Lstar_N=50.0039154...)
Converts given illuminance \(E\) value in lux to luminance in \(cd/m^2\).
Parameters: |
|
---|---|
Returns: | Luminance \(Y\) in \(cd/m^2\). |
Return type: | numeric or ndarray |
Examples
>>> illuminance_to_luminance(5000.0, 20.0)
318.3098861...
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([19.01, 20.00, 21.78])
>>> XYZ_to_RGB_Nayatani95(XYZ)
array([ 20.000520..., 19.999783..., 19.998831...])
Returns the scaling coefficient \(e(R)\) or \(e(G)\).
Parameters: |
|
---|---|
Returns: | Scaling coefficient \(e(R)\) or \(e(G)\). |
Return type: | numeric or ndarray |
Examples
>>> x = 20.000520600000002
>>> y = 1.000042192
>>> scaling_coefficient(x, y)
array(1.0)
Returns the achromatic response \(Q\) from given stimulus cone responses.
Parameters: |
|
---|---|
Returns: | Achromatic response \(Q\). |
Return type: | numeric or ndarray |
Examples
>>> RGB = np.array([20.00052060, 19.99978300, 19.99883160])
>>> bRGB_o = np.array([4.61062223, 4.61058926, 4.65206986])
>>> xez = np.array([1.00004219, 0.99998001, 0.99975794])
>>> bL_or = 3.6810214956040888
>>> eR = 1.0
>>> eG = 1.758
>>> n = 1.0
>>> achromatic_response(
... RGB, bRGB_o, xez, bL_or, eR, eG, n)
-0.0001169...
Returns the tritanopic response \(t\) from given stimulus cone responses.
Parameters: |
|
---|---|
Returns: | Tritanopic response \(t\). |
Return type: | numeric or ndarray |
Examples
>>> RGB = np.array([20.00052060, 19.99978300, 19.99883160])
>>> bRGB_o = np.array([4.61062223, 4.61058926, 4.65206986])
>>> xez = np.array([1.00004219, 0.99998001, 0.99975794])
>>> n = 1.0
>>> tritanopic_response(RGB, bRGB_o, xez, n)
-1.7703650...e-05
Returns the protanopic response \(p\) from given stimulus cone responses.
Parameters: |
|
---|---|
Returns: | Protanopic response \(p\). |
Return type: | numeric or ndarray |
Examples
>>> RGB = np.array([20.00052060, 19.99978300, 19.99883160])
>>> bRGB_o = np.array([4.61062223, 4.61058926, 4.65206986])
>>> xez = np.array([1.00004219, 0.99998001, 0.99975794])
>>> n = 1.0
>>> protanopic_response(RGB, bRGB_o, xez, n)
-8.0021426...e-05
Returns the brightness correlate \(B_r\).
Parameters: |
|
---|---|
Returns: | Brightness correlate \(B_r\). |
Return type: | numeric or ndarray |
Examples
>>> bRGB_o = np.array([4.61062223, 4.61058926, 4.65206986])
>>> bL_or = 3.6810214956040888
>>> Q = -0.000117024294955
>>> brightness_correlate(bRGB_o, bL_or, Q)
62.6266734...
Returns the ideal white brightness correlate \(B_{rw}\).
Parameters: |
|
---|---|
Returns: | Ideal white brightness correlate \(B_{rw}\). |
Return type: | numeric or ndarray |
Examples
>>> bRGB_o = np.array([4.61062223, 4.61058926, 4.65206986])
>>> xez = np.array([1.00004219, 0.99998001, 0.99975794])
>>> bL_or = 3.6810214956040888
>>> n = 1.0
>>> ideal_white_brightness_correlate(
... bRGB_o, xez, bL_or, n)
125.2435392...
Returns the achromatic Lightness correlate \(L_p^\star\).
Parameters: | Q (numeric or array_like) – Achromatic response \(Q\). |
---|---|
Returns: | Achromatic Lightness correlate \(L_p^\star\). |
Return type: | numeric or ndarray |
Examples
>>> Q = -0.000117024294955
>>> achromatic_lightness_correlate(Q)
49.9998829...
Returns the normalised achromatic Lightness correlate \(L_n^\star\).
Parameters: |
|
---|---|
Returns: | Normalised achromatic Lightness correlate \(L_n^\star\). |
Return type: | numeric or ndarray |
Examples
>>> B_r = 62.626673467230766
>>> B_rw = 125.24353925846037
>>> normalised_achromatic_lightness_correlate(
... B_r, B_rw)
50.0039154...
Returns the hue angle \(h\) in degrees.
Parameters: |
|
---|---|
Returns: | Hue angle \(h\) in degrees. |
Return type: | numeric or ndarray |
Examples
>>> p = -8.002142682085493e-05
>>> t = -1.7703650668990973e-05
>>> hue_angle(p, t)
257.5250300...
Returns the saturation components \(S_{RG}\) and \(S_{YB}\).
Parameters: |
|
---|---|
Returns: | Saturation components \(S_{RG}\) and \(S_{YB}\). |
Return type: | numeric or ndarray |
Examples
>>> h = 257.52322689806243
>>> bL_or = 3.6810214956040888
>>> t = -1.7706764677181658e-05
>>> p = -8.0023561356363753e-05
>>> saturation_components(h, bL_or, t, p)
array([-0.0028852..., -0.0130396...])
Returns the correlate of saturation \(S\).
Parameters: |
|
---|---|
Returns: | Correlate of saturation \(S\). |
Return type: | numeric or ndarray |
Examples
>>> S_RG = -0.0028852716381965863
>>> S_YB = -0.013039632941332499
>>> saturation_correlate(S_RG, S_YB)
0.0133550...
Returns the chroma components \(C_{RG}\) and \(C_{YB}\).
Parameters: |
|
---|---|
Returns: | Chroma components \(C_{RG}\) and \(C_{YB}\). |
Return type: | ndarray |
Examples
>>> Lstar_P = 49.99988297570504
>>> S_RG = -0.0028852716381965863
>>> S_YB = -0.013039632941332499
>>> chroma_components(Lstar_P, S_RG, S_YB)
array([-0.00288527, -0.01303961])
Returns the correlate of chroma \(C\).
Parameters: |
|
---|---|
Returns: | Correlate of chroma \(C\). |
Return type: | numeric or ndarray |
Examples
>>> Lstar_P = 49.99988297570504
>>> S = 0.013355029751777615
>>> chroma_correlate(Lstar_P, S)
0.0133550...
Returns the colourfulness components \(M_{RG}\) and \(M_{YB}\).
Parameters: |
|
---|---|
Returns: | Colourfulness components \(M_{RG}\) and \(M_{YB}\). |
Return type: | numeric or ndarray |
Examples
>>> C_RG = -0.0028852716381965863
>>> C_YB = -0.013039632941332499
>>> B_rw = 125.24353925846037
>>> colourfulness_components(C_RG, C_YB, B_rw)
(-0.0036136..., -0.0163312...)
Returns the correlate of colourfulness \(M\).
Parameters: |
|
---|---|
Returns: | Correlate of colourfulness \(M\). |
Return type: | numeric or ndarray |
Examples
>>> C = 0.013355007871688761
>>> B_rw = 125.24353925846037
>>> colourfulness_correlate(C, B_rw)
0.0167262...
Defines the chromatic strength function \(E_s(\theta)\) used to correct saturation scale as function of hue angle \(\theta\).
Parameters: | theta (numeric or array_like) – Hue angle \(\theta\) |
---|---|
Returns: | Corrected saturation scale. |
Return type: | numeric or ndarray |
Examples
>>> chromatic_strength_function(4.49462820973)
1.2267869...