Defines Nayatani (1995) colour appearance model objects:
References
[1] | Mark D. Fairchild, Color Appearance Models, 3nd Edition, The Wiley-IS&T Series in Imaging Science and Technology, published June 2013, ASIN: B00DAYO8E2, Locations 4810-5085. |
[2] | Y. Nayatani, H. Sobagaki & K. H. T. Yano, Lightness dependency of chroma scales of a nonlinear color-appearance model and its latest formulation, Color Research & Application, Volume 20, Issue 3, pages 156–167, June 1995, DOI: https://doi.org/10.1002/col.5080200305 |
Nayatani (1995) colour appearance model CIE XYZ colourspace 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 Mark D. Fairchild 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 Mark D. Fairchild 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
Raises: | ValueError – If Luminance factor Yo is not greater or equal than 18%. |
---|
Examples
>>> XYZ = np.array([19.01, 20, 21.78])
>>> XYZ_n = np.array([95.05, 100, 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/m2.
Parameters: |
|
---|---|
Returns: | Luminance Y in cd/m2. |
Return type: | numeric |
Examples
>>> illuminance_to_luminance(5000.0, 20.0)
318.3098861...
Returns the intermediate values ξ, η, ζ.
Parameters: | XYZ_n (array_like, (3,)) – CIE XYZ colourspace matrix of reference white in domain [0, 100]. |
---|---|
Returns: | Intermediate values ξ, η, ζ. |
Return type: | ndarray, (3,) |
Examples
>>> XYZ_n = np.array([95.05, 100, 108.88])
>>> intermediate_values(XYZ_n)
array([ 1.0000421..., 0.9999800..., 0.9997579...])
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([19.01, 20, 21.78])
>>> XYZ_to_RGB_Nayatani95(XYZ)
array([ 20.000520..., 19.999783..., 19.998831...])
Computes the exponent β1 for the middle and long-wavelength sensitive cones.
Parameters: | x (numeric) – Middle and long-wavelength sensitive cone response. |
---|---|
Returns: | Exponent β1. |
Return type: | numeric |
Examples
>>> beta_1(318.323316315)
4.6106222...
Computes the exponent β2 for the short-wavelength sensitive cones.
Parameters: | x (numeric) – Short-wavelength sensitive cone response. |
---|---|
Returns: | Exponent β2. |
Return type: | numeric |
Examples
>>> beta_2(318.323316315)
4.6522416...
Returns the chromatic adaptation exponential factors β1(Ro), math:beta_1(G_o)` and β2(Bo) of given cone responses.
Parameters: | RGB_o (ndarray, (3,)) – Cone responses. |
---|---|
Returns: | Chromatic adaptation exponential factors β1(Ro), math:beta_1(G_o)` and β2(Bo). |
Return type: | ndarray, (3,) |
Examples
>>> RGB_o = np.array([318.32331631, 318.30352317, 318.23283482])
>>> chromatic_adaptation_exponential_factors(RGB_o)
array([ 4.6106222..., 4.6105892..., 4.6520698...])
Returns the scaling coefficient e(R) or e(G).
Parameters: |
|
---|---|
Returns: | Scaling coefficient e(R) or e(G). |
Return type: | numeric |
Examples
>>> x = 20.000520600000002
>>> y = 1.000042192
>>> scaling_coefficient(x, y)
1
Returns the achromatic response Q from given stimulus cone responses.
Parameters: |
|
---|---|
Returns: | Achromatic response Q. |
Return type: | numeric |
Examples
>>> RGB = np.array([20.0005206, 19.999783, 19.9988316])
>>> bRGB_o = np.array([4.61062223, 4.61058926, 4.65206986])
>>> x_e_z = 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, x_e_z, 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 |
Examples
>>> RGB = np.array([20.0005206, 19.999783, 19.9988316])
>>> bRGB_o = np.array([4.61062223, 4.61058926, 4.65206986])
>>> x_e_z = np.array([1.00004219, 0.99998001, 0.99975794])
>>> n = 1.0
>>> tritanopic_response(RGB, bRGB_o, x_e_z, n)
-1.7703650...e-05
Returns the protanopic response p from given stimulus cone responses.
Parameters: |
|
---|---|
Returns: | Protanopic response p. |
Return type: | numeric |
Examples
>>> RGB = np.array([20.0005206, 19.999783, 19.9988316])
>>> bRGB_o = np.array([4.61062223, 4.61058926, 4.65206986])
>>> x_e_z = np.array([1.00004219, 0.99998001, 0.99975794])
>>> n = 1.0
>>> protanopic_response(RGB, bRGB_o, x_e_z, n)
-8.0021426...e-05
Returns the brightness correlate Br.
Parameters: |
|
---|---|
Returns: | Brightness correlate Br. |
Return type: | numeric |
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 Brw.
Parameters: |
|
---|---|
Returns: | Ideal white brightness correlate Brw. |
Return type: | numeric |
Examples
>>> bRGB_o = np.array([4.61062223, 4.61058926, 4.65206986])
>>> x_e_z = np.array([1.00004219, 0.99998001, 0.99975794])
>>> bL_or = 3.6810214956040888
>>> n = 1.0
>>> ideal_white_brightness_correlate(bRGB_o, x_e_z, bL_or, n)
125.2435392...
Returns the achromatic Lightness correlate L⋆p.
Parameters: | Q (numeric) – Achromatic response Q. |
---|---|
Returns: | Achromatic Lightness correlate L⋆p. |
Return type: | numeric |
Examples
>>> Q = -0.000117024294955
>>> achromatic_lightness_correlate(Q)
49.9998829...
Returns the normalised achromatic Lightness correlate L⋆n.
Parameters: |
|
---|---|
Returns: | Normalised achromatic Lightness correlate L⋆n. |
Return type: | numeric |
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 |
Examples
>>> p = -8.002142682085493e-05
>>> t = -1.7703650668990973e-05
>>> hue_angle(p, t)
257.5250300...
Returns the saturation components SRG and SYB.
Parameters: |
|
---|---|
Returns: | Saturation components SRG and SYB. |
Return type: | numeric |
Examples
>>> h = 257.52322689806243
>>> bL_or = 3.6810214956040888
>>> t = -1.7706764677181658e-05
>>> p = -8.0023561356363753e-05
>>> saturation_components(h, bL_or, t, p)
(-0.0028852..., -0.0130396...)
Returns the correlate of saturation S.
Parameters: |
|
---|---|
Returns: | Correlate of saturation S. |
Return type: | numeric |
Examples
>>> S_RG = -0.0028852716381965863
>>> S_YB = -0.013039632941332499
>>> saturation_correlate(S_RG, S_YB)
0.0133550...
Returns the chroma components CRG and CYB.
Parameters: |
|
---|---|
Returns: | Chroma components CRG and CYB. |
Return type: | numeric |
Examples
>>> Lstar_P = 49.99988297570504
>>> S_RG = -0.0028852716381965863
>>> S_YB = -0.013039632941332499
>>> chroma_components(Lstar_P, S_RG, S_YB)
(-0.0028852..., -0.0130396...)
Returns the correlate of chroma C.
Parameters: |
|
---|---|
Returns: | Correlate of chroma C. |
Return type: | numeric |
Examples
>>> Lstar_P = 49.99988297570504
>>> S = 0.013355029751777615
>>> chroma_correlate(Lstar_P, S)
0.0133550...
Returns the colourfulness components MRG and MYB.
Parameters: |
|
---|---|
Returns: | Colourfulness components MRG and MYB. |
Return type: | numeric |
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 |
Examples
>>> C = 0.013355007871688761
>>> B_rw = 125.24353925846037
>>> colourfulness_correlate(C, B_rw)
0.0167262...
Defines the chromatic strength function Es(θ) used to correct saturation scale as function of hue angle θ.
Parameters: | theta (numeric) – Hue angle θ |
---|---|
Returns: | Corrected saturation scale. |
Return type: | numeric |
Examples
>>> chromatic_strength_function(4.49462820973)
1.2267869...