colour.colorimetry.lightness Module

Lightness \(L*\)

Defines Lightness \(L*\) computation objects.

The following methods are available:

  • lightness_glasser1958(): Lightness \(L^*\) computation of given luminance \(Y\) using Glasser et al. (1958) method.
  • lightness_wyszecki1964(): Lightness \(W^*\) computation of given luminance \(Y\) using Wyszecki (1964) method.
  • lightness_1976(): Lightness \(L^*\) computation of given luminance \(Y\) as per CIE Lab implementation.
colour.colorimetry.lightness.lightness_glasser1958(Y, **kwargs)[source]

Returns the Lightness \(L^*\) of given luminance \(Y\) using Glasser et al. (1958) method.

Parameters:
  • Y (numeric) – luminance \(Y\).
  • **kwargs (**, optional) – Unused parameter provided for signature compatibility with other Lightness computation objects.
Returns:

Lightness \(L^*\).

Return type:

numeric

Notes

  • Input luminance \(Y\) is in domain [0, 100].
  • Output Lightness \(L^*\) is in domain [0, 100].

References

[1]http://en.wikipedia.org/wiki/Lightness (Last accessed 13 April 2014)

Examples

>>> lightness_glasser1958(10.08)  
36.2505626...
colour.colorimetry.lightness.lightness_wyszecki1964(Y, **kwargs)[source]

Returns the Lightness \(W^*\) of given luminance \(Y\) using Wyszecki (1964) method.

Parameters:
  • Y (numeric) – luminance \(Y\).
  • **kwargs (**, optional) – Unused parameter provided for signature compatibility with other Lightness computation objects.
Returns:

Lightness \(W^*\).

Return type:

numeric

Notes

  • Input luminance \(Y\) is in domain [0, 100].
  • Output Lightness \(W^*\) is in domain [0, 100].

References

[1]http://en.wikipedia.org/wiki/Lightness (Last accessed 13 April 2014)

Examples

>>> lightness_wyszecki1964(10.08)  
37.0041149...
colour.colorimetry.lightness.lightness_1976(Y, Yn=100)[source]

Returns the Lightness \(L^*\) of given luminance \(Y\) using given reference white luminance \(Y_n\) as per CIE Lab implementation.

Parameters:
  • Y (numeric) – luminance \(Y\).
  • Yn (numeric, optional) – White reference luminance \(Y_n\).
Returns:

Lightness \(L^*\).

Return type:

numeric

Notes

  • Input luminance \(Y\) and \(Y_n\) are in domain [0, 100].
  • Output Lightness \(L^*\) is in domain [0, 100].

References

[2]http://www.poynton.com/PDFs/GammaFAQ.pdf (Last accessed 12 April 2014)

Examples

>>> lightness_1976(10.08)  
37.9856290...
colour.colorimetry.lightness.LIGHTNESS_METHODS = CaseInsensitiveMapping({u'Lstar1976': <function lightness_1976 at 0x102e0a2a8>, u'Wyszecki 1964': <function lightness_wyszecki1964 at 0x102e0a230>, u'CIE 1976': <function lightness_1976 at 0x102e0a2a8>, u'Glasser 1958': <function lightness_glasser1958 at 0x102e0a1b8>})

Supported Lightness computations methods.

LIGHTNESS_METHODS : dict
(‘Glasser 1958’, ‘Wyszecki 1964’, ‘CIE 1976’)

Aliases:

  • ‘Lstar1976’: ‘CIE 1976’
colour.colorimetry.lightness.lightness(Y, method=u'CIE 1976', **kwargs)[source]

Returns the Lightness \(L^*\) using given method.

Parameters:
  • Y (numeric) – luminance \(Y\).
  • method (unicode, optional) – (‘Glasser 1958’, ‘Wyszecki 1964’, ‘CIE 1976’), Computation method.
  • **kwargs (**) – Keywords arguments.
Returns:

Lightness \(L^*\).

Return type:

numeric

Notes

  • Input luminance \(Y\) and optional \(Y_n\) are in domain [0, 100].
  • Output Lightness \(L^*\) is in domain [0, 100].

Examples

>>> lightness(10.08)  
37.9856290...
>>> lightness(10.08, Yn=100)  
37.9856290...
>>> lightness(10.08, Yn=95)  
38.9165987...
>>> lightness(10.08, method='Glasser 1958')  
36.2505626...
>>> lightness(10.08, method='Wyszecki 1964')  
37.0041149...