colour.colorimetry.whiteness Module

Whiteness Index \(W\)

Defines whiteness index \(W\) computation objects:

References

[1]Wikipedia. (n.d.). Whiteness. Retrieved September 17, 2014, from http://en.wikipedia.org/wiki/Whiteness
[2](1, 2, 3, 4, 5, 6) X-Rite, & Pantone. (2012). Color iQC and Color iMatch Color Calculations Guide. Retrieved from http://www.xrite.com/documents/literature/en/09_Color_Calculations_en.pdf
[3]Wyszecki, G., & Stiles, W. S. (2000). Table I(6.5.3) Whiteness Formulae (Whiteness Measure Denoted by W). In Color Science: Concepts and Methods, Quantitative Data and Formulae (pp. 837–839). Wiley. ISBN:978-0471399186
colour.colorimetry.whiteness.whiteness_Berger1959(XYZ, XYZ_0)[source]

Returns the whiteness index \(WI\) of given sample CIE XYZ colourspace matrix using Berger (1959) method. [2]

Parameters:
  • XYZ (array_like) – CIE XYZ colourspace matrix of sample.
  • XYZ_0 (array_like) – CIE XYZ colourspace matrix of reference white.
Returns:

Whiteness \(WI\).

Return type:

numeric

Notes

  • Input CIE XYZ and CIE XYZ_0 colourspace matrices are in domain [0, 100].
  • Whiteness \(WI\) values larger than 33.33 indicate a bluish white, and values smaller than 33.33 indicate a yellowish white.

Warning

The input domain of that definition is non standard!

Examples

>>> XYZ = np.array([95., 100., 105.])
>>> XYZ_0 = np.array([94.80966767, 100., 107.30513595])
>>> whiteness_Berger1959(XYZ, XYZ_0)  
30.3638017...
colour.colorimetry.whiteness.whiteness_Taube1960(XYZ, XYZ_0)[source]

Returns the whiteness index \(WI\) of given sample CIE XYZ colourspace matrix using Taube (1960) method. [2]

Parameters:
  • XYZ (array_like) – CIE XYZ colourspace matrix of sample.
  • XYZ_0 (array_like) – CIE XYZ colourspace matrix of reference white.
Returns:

Whiteness \(WI\).

Return type:

numeric

Notes

  • Input CIE XYZ and CIE XYZ_0 colourspace matrices are in domain [0, 100].
  • Whiteness \(WI\) values larger than 100 indicate a bluish white, and values smaller than 100 indicate a yellowish white.

Examples

>>> XYZ = np.array([95., 100., 105.])
>>> XYZ_0 = np.array([94.80966767, 100., 107.30513595])
>>> whiteness_Taube1960(XYZ, XYZ_0)  
91.4071738...
colour.colorimetry.whiteness.whiteness_Stensby1968(Lab)[source]

Returns the whiteness index \(WI\) of given sample CIE Lab colourspace matrix using Stensby (1968) method. [2]

Parameters:Lab (array_like) – CIE Lab colourspace matrix of sample.
Returns:Whiteness \(WI\).
Return type:numeric

Notes

  • Input CIE Lab colourspace matrix are in domain [0, 100].
  • Whiteness \(WI\) values larger than 100 indicate a bluish white, and values smaller than 100 indicate a yellowish white.

Examples

>>> Lab = np.array([100., -2.46875131, -16.72486654])
>>> whiteness_Stensby1968(Lab)  
142.7683456...
colour.colorimetry.whiteness.whiteness_ASTM313(XYZ)[source]

Returns the whiteness index \(WI\) of given sample CIE XYZ colourspace matrix using ASTM 313 method. [2]

Parameters:XYZ (array_like) – CIE XYZ colourspace matrix of sample.
Returns:Whiteness \(WI\).
Return type:numeric

Notes

  • Input CIE XYZ colourspace matrix is in domain [0, 100].

Warning

The input domain of that definition is non standard!

Examples

>>> XYZ = np.array([95., 100., 105.])
>>> whiteness_ASTM313(XYZ)  
55.7400000...
colour.colorimetry.whiteness.whiteness_Ganz1979(xy, Y)[source]

Returns the whiteness index \(W\) and tint \(T\) of given sample xy chromaticity coordinates using Ganz and Griesser (1979) method. [2]

Parameters:
  • xy (tuple) – Chromaticity coordinates xy of sample.
  • Y (numeric) – Tristimulus \(Y\) value of sample.
Returns:

Whiteness \(W\) and tint \(T\).

Return type:

tuple

Notes

  • Input tristimulus \(Y\) value is in domain [0, 100].
  • The formula coefficients are valid for CIE Standard Illuminant D Series D65 and CIE 1964 10 Degree Standard Observer.
  • Positive output tint \(T\) values indicate a greener tint while negative values indicate a redder tint.
  • Whiteness differences of less than 5 Ganz units appear to be indistinguishable to the human eye.
  • Tint differences of less than 0.5 Ganz units appear to be indistinguishable to the human eye.

Warning

The input domain of that definition is non standard!

Examples

>>> whiteness_Ganz1979((0.3167, 0.3334), 100.)  
(85.6003766..., 0.6789002...)
colour.colorimetry.whiteness.whiteness_CIE2004(xy, Y, xy_n, observer=u'CIE 1931 2 Degree Standard Observer')[source]

Returns the whiteness \(W\) or \(W_{10}\) and tint \(T\) or \(T_{10}\) of given sample xy chromaticity coordinates using CIE 2004 method.

Parameters:
  • xy (tuple) – Chromaticity coordinates xy of sample.
  • Y (numeric) – Tristimulus \(Y\) value of sample.
  • xy_n (tuple) – Chromaticity coordinates xy_n of perfect diffuser.
  • observer (unicode, optional) – {‘CIE 1931 2 Degree Standard Observer’, ‘CIE 1964 10 Degree Standard Observer’} CIE Standard Observer used for computations, tint \(T\) or \(T_{10}\) value is dependent on viewing field angular subtense.
Returns:

Whiteness \(W\) or \(W_{10}\) and tint \(T\) or \(T_{10}\) of given sample.

Return type:

tuple

Notes

  • Input tristimulus \(Y\) value is in domain [0, 100].
  • This method may be used only for samples whose values of \(W\) or \(W_{10}\) lie within the following limits: greater than 40 and less than 5Y - 280, or 5Y10 - 280.
  • This method may be used only for samples whose values of \(T\) or \(T_{10}\) lie within the following limits: greater than -4 and less than +2.
  • Output whiteness \(W\) or \(W_{10}\) values larger than 100 indicate a bluish white while values smaller than 100 indicate a yellowish white. [2]
  • Positive output tint \(T\) or \(T_{10}\) values indicate a greener tint while negative values indicate a redder tint.

Warning

The input domain of that definition is non standard!

References

[4]CIE TC 1-48. (2004). The evaluation of whiteness. In CIE 015:2004 Colorimetry, 3rd Edition (p. 24). ISBN:978-3-901-90633-6

Examples

>>> xy_n = (0.3139, 0.3311)
>>> whiteness_CIE2004((0.3167, 0.3334), 100., xy_n)  
(93.8500000..., -1.3049999...)
colour.colorimetry.whiteness.WHITENESS_METHODS = CaseInsensitiveMapping({u'ASTM 313': <function whiteness_ASTM313 at 0x2b437a9bb500>, u'Ganz 1979': <function whiteness_Ganz1979 at 0x2b437a9bb578>, u'Stensby 1968': <function whiteness_Stensby1968 at 0x2b437a9bb488>, u'Taube 1960': <function whiteness_Taube1960 at 0x2b437a9bb410>, u'Berger 1959': <function whiteness_Berger1959 at 0x2b437a9bb140>, u'CIE 2004': <function whiteness_CIE2004 at 0x2b437a9bb5f0>, u'cie2004': <function whiteness_CIE2004 at 0x2b437a9bb5f0>})

Supported whiteness computations methods.

WHITENESS_METHODS : CaseInsensitiveMapping
{‘CIE 2004’, ‘Berger 1959’, ‘Taube 1960’, ‘Stensby 1968’, ‘ASTM 313’, ‘Ganz 1979’, ‘CIE 2004’}

Aliases:

  • ‘cie2004’: ‘CIE 2004’
colour.colorimetry.whiteness.whiteness(method=u'CIE 2004', **kwargs)[source]

Returns the whiteness \(W\) using given method.

Parameters:
  • method (unicode, optional) – {‘CIE 2004’, ‘Berger 1959’, ‘Taube 1960’, ‘Stensby 1968’, ‘ASTM 313’, ‘Ganz 1979’, ‘CIE 2004’} Computation method.
  • **kwargs (**) – Keywords arguments.
Returns:

whiteness \(W\).

Return type:

numeric

Examples

>>> xy = (0.3167, 0.3334)
>>> Y = 100
>>> xy_n = (0.3139, 0.3311)
>>> whiteness(xy=xy, Y=Y, xy_n=xy_n)  
(93.8500000..., -1.3049999...)
>>> XYZ = np.array([95., 100., 105.])
>>> XYZ_0 = np.array([94.80966767, 100., 107.30513595])
>>> method = 'Taube 1960'
>>> whiteness(XYZ=XYZ, XYZ_0=XYZ_0, method=method)  
91.4071738...