colour.appearance.atd95 Module

ATD (1995) Colour Vision Model

Defines ATD (1995) colour vision model objects:

Notes

  • According to CIE TC1-34 definition of a colour appearance model, the ATD95 model cannot be considered as a colour appearance model. It was developed with different aims and is described as a model of colour vision.

References

[1]Fairchild, M. D. (2013). ATD Model. In Color Appearance Models (3rd ed., pp. 5852–5991). Wiley. ASIN:B00DAYO8E2
[2]Guth, S. L. (1995). Further applications of the ATD model for color vision. In E. Walowit (Ed.), IS&T/SPIE’s Symposium on Electronic … (Vol. 2414, pp. 12–26). doi:10.1117/12.206546
class colour.appearance.atd95.ATD95_ReferenceSpecification[source]

Bases: colour.appearance.atd95.ATD95_ReferenceSpecification

Defines the ATD (1995) colour vision model reference specification.

This specification has field names consistent with Fairchild (2013) reference.

Parameters:
  • H (numeric) – Hue angle \(H\) in degrees.
  • C (numeric) – Correlate of saturation \(C\). Guth (1995) incorrectly uses the terms saturation and chroma interchangeably. However, \(C\) is here a measure of saturation rather than chroma since it is measured relative to the achromatic response for the stimulus rather than that of a similarly illuminated white.
  • Br (numeric) – Correlate of brightness \(Br\).
  • A_1 (numeric) – First stage \(A_1\) response.
  • T_1 (numeric) – First stage \(T_1\) response.
  • D_1 (numeric) – First stage \(D_1\) response.
  • A_2 (numeric) – Second stage \(A_2\) response.
  • T_2 (numeric) – Second stage \(A_2\) response.
  • D_2 (numeric) – Second stage \(D_2\) response.
class colour.appearance.atd95.ATD95_Specification[source]

Bases: colour.appearance.atd95.ATD95_Specification

Defines the ATD (1995) colour vision model specification.

This specification has field names consistent with the remaining colour appearance models in colour.appearance but diverge from Fairchild (2013) reference.

Notes

  • This specification is the one used in the current model implementation.
Parameters:
  • h (numeric) – Hue angle \(H\) in degrees.
  • C (numeric) – Correlate of saturation \(C\). Guth (1995) incorrectly uses the terms saturation and chroma interchangeably. However, \(C\) is here a measure of saturation rather than chroma since it is measured relative to the achromatic response for the stimulus rather than that of a similarly illuminated white.
  • Q (numeric) – Correlate of brightness \(Br\).
  • A_1 (numeric) – First stage \(A_1\) response.
  • T_1 (numeric) – First stage \(T_1\) response.
  • D_1 (numeric) – First stage \(D_1\) response.
  • A_2 (numeric) – Second stage \(A_2\) response.
  • T_2 (numeric) – Second stage \(A_2\) response.
  • D_2 (numeric) – Second stage \(D_2\) response.
colour.appearance.atd95.XYZ_to_ATD95(XYZ, XYZ_0, Y_0, k_1, k_2, sigma=300)[source]

Computes the ATD (1995) colour vision model correlates.

Parameters:
  • XYZ (array_like, (3,)) – CIE XYZ colourspace matrix of test sample / stimulus in domain [0, 100].
  • XYZ_0 (array_like, (3,)) – CIE XYZ colourspace matrix of reference white in domain [0, 100].
  • Y_0 (numeric) – Absolute adapting field luminance in \(cd/m^2\).
  • k_1 (numeric) – Application specific weight \(k_1\).
  • k_2 (numeric) – Application specific weight \(k_2\).
  • sigma (numeric, optional) – Constant \(\sigma\) varied to predict different types of data.
Returns:

ATD (1995) colour vision model specification.

Return type:

ATD95_Specification

Warning

The input domain of that definition is non standard!

Notes

  • Input CIE XYZ colourspace matrix is in domain [0, 100].
  • Input CIE XYZ_0 colourspace matrix is in domain [0, 100].
  • For unrelated colors, there is only self-adaptation, and \(k_1\) is set to 1.0 while \(k_2\) is set to 0.0. For related colors such as typical colorimetric applications, \(k_1\) is set to 0.0 and \(k_2\) is set to a value between 15 and 50 (Guth, 1995).

Examples

>>> XYZ = np.array([19.01, 20.00, 21.78])
>>> XYZ_0 = np.array([95.05, 100.00, 108.88])
>>> Y_0 = 318.31
>>> k_1 = 0.0
>>> k_2 = 50.0
>>> XYZ_to_ATD95(XYZ, XYZ_0, Y_0, k_1, k_2)  
ATD95_Specification(h=1.9089869..., C=1.2064060..., Q=0.1814003..., A_1=0.1787931... T_1=0.0286942..., D_1=0.0107584..., A_2=0.0192182..., T_2=0.0205377..., D_2=0.0107584...)
colour.appearance.atd95.luminance_to_retinal_illuminance(XYZ, Y_c)[source]

Converts from luminance in \(cd/m^2\) to retinal illuminance in trolands.

Parameters:
  • XYZ (array_like, (3,)) – CIE XYZ colourspace matrix.
  • Y_c (numeric) – Absolute adapting field luminance in \(cd/m^2\).
Returns:

Converted CIE XYZ colourspace matrix in trolands.

Return type:

ndarray

Examples

>>> XYZ = np.array([19.01, 20., 21.78])
>>> Y_0 = 318.31
>>> luminance_to_retinal_illuminance(XYZ, Y_0)  
array([ 479.4445924...,  499.3174313...,  534.5631673...])
colour.appearance.atd95.XYZ_to_LMS_ATD95(XYZ)[source]

Converts from CIE XYZ colourspace to LMS cone responses.

Parameters:XYZ (array_like, (3,)) – CIE XYZ colourspace matrix.
Returns:LMS cone responses.
Return type:ndarray, (3,)

Examples

>>> XYZ = np.array([19.01, 20., 21.78])
>>> XYZ_to_LMS_ATD95(XYZ)  
array([ 6.2283272...,  7.4780666...,  3.8859772...])
colour.appearance.atd95.opponent_colour_dimensions(LMS_g)[source]

Returns opponent colour dimensions from given post adaptation cone signals matrix.

Parameters:LMS_g (array_like, (3,)) – Post adaptation cone signals matrix.
Returns:Opponent colour dimensions.
Return type:tuple

Examples

>>> from pprint import pprint
>>> LMS_g = np.array([6.95457922, 7.08945043, 6.44069316])
>>> pprint(opponent_colour_dimensions(LMS_g))  
(0.1787931...,
 0.0286942...,
 0.0107584...,
 0.0192182...,
 0.0205377...,
 0.0107584...)
colour.appearance.atd95.final_response(value)[source]

Returns the final response of given opponent colour dimension.

Parameters:value (numeric) – Opponent colour dimension.
Returns:Final response of opponent colour dimension.
Return type:numeric

Examples

>>> final_response(43.54399695501678)  
0.1787931...