Defines Hunt colour appearance model objects:
References
[1] | Fairchild, M. D. (2013). The Hunt Model. In Color Appearance Models (3rd ed., pp. 5094–5556). Wiley. ASIN:B00DAYO8E2 |
[2] | Hunt, R. W. G. (2004). The Reproduction of Colour (6th ed.). Wiley. ISBN:978-0-470-02425-6 |
Bases: colour.appearance.hunt.Hunt_InductionFactors
Hunt colour appearance model induction factors.
Parameters: |
|
---|
Reference Hunt colour appearance model viewing conditions.
Aliases:
Hunt colour appearance model CIE XYZ colourspace matrix to Hunt-Pointer-Estevez \(\rho\gamma\beta\) colourspace matrix.
XYZ_TO_HPE_MATRIX : array_like, (3, 3)
Hunt colour appearance model Hunt-Pointer-Estevez \(\rho\gamma\beta\) colourspace to CIE XYZ colourspace matrix matrix.
HPE_TO_XYZ_MATRIX : array_like, (3, 3)
Bases: colour.appearance.hunt.Hunt_ReferenceSpecification
Defines the Hunt colour appearance model reference specification.
This specification has field names consistent with Fairchild (2013) reference.
Parameters: |
|
---|
Bases: colour.appearance.hunt.Hunt_Specification
Defines the Hunt 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 Hunt colour appearance model correlates.
Parameters: |
|
---|
Warning
The input domain of that definition is non standard!
Notes
Returns: | Hunt colour appearance model specification. |
---|---|
Return type: | Hunt_Specification |
Raises: | ValueError – If an illegal arguments combination is specified. |
Examples
>>> XYZ = np.array([19.01, 20.00, 21.78])
>>> XYZ_w = np.array([95.05, 100.00, 108.88])
>>> XYZ_b = np.array([95.05, 100.00, 108.88])
>>> L_A = 318.31
>>> surround = HUNT_VIEWING_CONDITIONS['Normal Scenes']
>>> CCT_w = 6504.0
>>> XYZ_to_Hunt(XYZ, XYZ_w, XYZ_b, L_A, surround, CCT_w=CCT_w)
Hunt_Specification(J=30.0462678..., C=0.1210508..., h=269.2737594..., s=0.0199093..., Q=22.2097654..., M=0.1238964..., H=None, HC=None)
Returns the luminance level adaptation factor \(F_L\).
Parameters: | L_A (numeric) – Adapting field luminance \(L_A\) in \(cd/m^2\). |
---|---|
Returns: | Luminance level adaptation factor \(F_L\) |
Return type: | numeric |
Examples
>>> luminance_level_adaptation_factor(318.31)
1.1675444...
Returns the approximate scotopic luminance \(L_{AS}\) of the illuminant.
Parameters: |
|
---|---|
Returns: | Approximate scotopic luminance \(L_{AS}\). |
Return type: | numeric |
Examples
>>> illuminant_scotopic_luminance(318.31, 6504.0)
769.9376286...
Converts from CIE XYZ colourspace to Hunt-Pointer-Estevez \(\rho\gamma\beta\) colourspace.
Parameters: | XYZ (array_like, (3,)) – CIE XYZ colourspace matrix. |
---|---|
Returns: | Hunt-Pointer-Estevez \(\rho\gamma\beta\) colourspace matrix. |
Return type: | ndarray, (3,) |
Examples
>>> XYZ = np.array([19.01, 20, 21.78])
>>> XYZ_to_rgb(XYZ)
array([ 19.4743367..., 20.3101217..., 21.78 ])
Defines the nonlinear response function of the Hunt colour appearance model used to model the nonlinear behavior of various visual responses.
Parameters: | x (numeric or array_like) – Visual response variable \(x\). |
---|---|
Returns: | Modeled visual response variable \(x\). |
Return type: | numeric or array_like |
Examples
>>> x = np.array([0.23350512, 0.23351103, 0.23355179])
>>> f_n(x)
array([ 5.8968592..., 5.8969521..., 5.8975927...])
Applies chromatic adaptation to given CIE XYZ colourspace matrix.
Parameters: |
|
---|---|
Returns: | Adapted CIE XYZ colourspace matrix. |
Return type: | ndarray, (3,) |
Examples
>>> XYZ = np.array([19.01, 20.00, 21.78])
>>> XYZ_b = np.array([95.05, 100.00, 108.88])
>>> XYZ_w = np.array([95.05, 100.00, 108.88])
>>> L_A = 318.31
>>> F_L = 1.16754446415
>>> chromatic_adaptation(XYZ, XYZ_w, XYZ_b, L_A, F_L)
array([ 6.8959454..., 6.8959991..., 6.8965708...])
Adjusts the white point for simultaneous chromatic contrast.
Parameters: |
|
---|---|
Returns: | Adjusted cone signals Hunt-Pointer-Estevez \(\rho\gamma\beta\) matrix of the reference white. |
Return type: | ndarray |
Examples
>>> rgb_p = np.array([98.0719355, 101.1375595, 100])
>>> rgb_b = np.array([0.99984505, 0.9998384, 0.99982674])
>>> rgb_w = np.array([97.3732571, 101.5496803, 108.88])
>>> p = 0.1
>>> adjusted_reference_white_signals(rgb_p, rgb_b, rgb_w, p)
array([ 88.0792742..., 91.8569553..., 98.4876543...])
Returns the achromatic post adaptation signal \(A\) from given Hunt-Pointer-Estevez \(\rho\gamma\beta\) colourspace matrix.
Parameters: | rgb (array_like, (3,)) – Hunt-Pointer-Estevez \(\rho\gamma\beta\) colourspace matrix. |
---|---|
Returns: | Achromatic post adaptation signal \(A\). |
Return type: | numeric |
Examples
>>> rgb = np.array([6.89594549, 6.89599915, 6.89657085])
>>> achromatic_post_adaptation_signal(rgb)
18.9827186...
Returns the colour difference signals \(C_1\), \(C_2\) and \(C_3\) from given Hunt-Pointer-Estevez \(\rho\gamma\beta\) colourspace matrix.
Parameters: | rgb (array_like, (3,)) – Hunt-Pointer-Estevez \(\rho\gamma\beta\) colourspace matrix. |
---|---|
Returns: | Colour difference signals \(C_1\), \(C_2\) and \(C_3\). |
Return type: | tuple |
Examples
>>> rgb = np.array([6.89594549, 6.89599915, 6.89657085])
>>> colour_difference_signals(rgb)
(-5.3659999...e-05, -0.0005717..., 0.0006253...)
Returns the hue angle \(h\) from given colour difference signals \(C\).
Parameters: | C (array_like) – Colour difference signals \(C\). |
---|---|
Returns: | Hue angle \(h\). |
Return type: | numeric |
Examples
>>> C = (-5.3658655819965873e-05,
... -0.00057169938364687312,
... 0.00062535803946683899)
>>> hue_angle(C)
269.2737594...
Returns eccentricity factor \(e_s\) from given hue angle \(h\).
Parameters: | numeric – Hue angle \(h\). |
---|---|
Returns: | Eccentricity factor \(e_s\). |
Return type: | float |
Examples
>>> eccentricity_factor(269.273759)
1.1108365...
Returns the low luminance tritanopia factor \(F_t\) from given adapting field luminance \(L_A\) in \(cd/m^2\).
Parameters: | L_A (numeric) – Adapting field luminance \(L_A\) in \(cd/m^2\). |
---|---|
Returns: | Low luminance tritanopia factor \(F_t\). |
Return type: | numeric |
Examples
>>> low_luminance_tritanopia_factor(318.31)
0.9996859...
Returns the yellowness / blueness response \(M_{yb}\).
Parameters: |
|
---|---|
Returns: | Yellowness / blueness response \(M_{yb}\). |
Return type: | numeric |
Examples
>>> C = (-5.3658655819965873e-05,
... -0.00057169938364687312,
... 0.00062535803946683899)
>>> e_s = 1.1108365048626296
>>> N_c = 1.0
>>> N_cb = 0.72499999999999998
>>> F_t =0.99968593951195
>>> yellowness_blueness_response(C, e_s, N_c, N_cb, F_t)
-0.0082372...
Returns the redness / greenness response \(M_{yb}\).
Parameters: |
|
---|---|
Returns: | Redness / greenness response \(M_{rg}\). |
Return type: | numeric |
Examples
>>> C = (-5.3658655819965873e-05,
... -0.00057169938364687312,
... 0.00062535803946683899)
>>> e_s = 1.1108365048626296
>>> N_c = 1.0
>>> N_cb = 0.72499999999999998
>>> redness_greenness_response(C, e_s, N_c, N_cb)
-0.0001044...
Returns the overall chromatic response \(M\).
Parameters: |
|
---|---|
Returns: | Overall chromatic response \(M\). |
Return type: | numeric |
Examples
>>> M_yb = -0.008237223618824608
>>> M_rg = -0.00010444758327626432
>>> overall_chromatic_response(M_yb, M_rg)
0.0082378...
Returns the saturation correlate \(s\).
Parameters: |
|
---|---|
Returns: | Saturation correlate \(s\). |
Return type: | numeric |
Examples
>>> M = 0.008237885787274198
>>> rgb_a = np.array([6.89594549, 6.89599915, 6.89657085])
>>> saturation_correlate(M, rgb_a)
0.0199093...
Returns the achromatic signal \(A\).
Parameters: |
|
---|---|
Returns: | Achromatic signal \(A\). |
Return type: | numeric |
Examples
>>> L_AS = 769.9376286541402
>>> S = 20.0
>>> S_W = 100.0
>>> N_bb = 0.72499999999999998
>>> A_a = 18.982718664838487
>>> achromatic_signal(L_AS, S, S_W, N_bb, A_a)
15.5068546...
Returns the brightness correlate \(Q\).
Parameters: |
|
---|---|
Returns: | Brightness correlate \(Q\). |
Return type: | numeric |
Examples
>>> A = 15.506854623621885
>>> A_w = 35.718916676317086
>>> M = 0.0082378857872741976
>>> N_b = 75.0
>>> brightness_correlate(A, A_w, M, N_b)
22.2097654...
Returns the Lightness correlate \(J\).
Parameters: |
|
---|---|
Returns: | Lightness correlate \(J\). |
Return type: | numeric |
Examples
>>> Y_b = 100.0
>>> Y_w = 100.0
>>> Q = 22.209765491265024
>>> Q_w = 40.518065821226081
>>> lightness_correlate(Y_b, Y_w, Q, Q_w)
30.0462678...
Returns the chroma correlate \(C_94\).
Parameters: |
|
---|---|
Returns: | Chroma correlate \(C_94\). |
Return type: | numeric |
Examples
>>> s = 0.0199093206929
>>> Y_b = 100.0
>>> Y_w = 100.0
>>> Q = 22.209765491265024
>>> Q_w = 40.518065821226081
>>> chroma_correlate(s, Y_b, Y_w, Q, Q_w)
0.1210508...
Returns the colourfulness correlate \(M_94\).
Parameters: |
|
---|---|
Returns: | Colourfulness correlate \(M_94\). |
Return type: | numeric |
Examples
>>> F_L = 1.16754446414718
>>> C_94 = 0.12105083993617581
>>> colourfulness_correlate(F_L, C_94)
0.1238964...