Defines various objects for Munsell Renotation System computations:
References
[1] | (1, 2, 3) Paul Centore, Munsell and Kubelka-Munk Toolbox (Last accessed 26 July 2014) |
[2] | (1, 2, 3) Paul Centore, An Open-Source Inversion Algorithm for the Munsell Renotation, DOI: https://doi.org/10.1002/col.20715, (Last accessed 26 July 2014) |
Returns the Munsell value \(V\) of given luminance \(Y\) using Priest et al. (1920) method.
Parameters: | Y (numeric) – luminance \(Y\). |
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric |
Notes
References
[3] | http://en.wikipedia.org/wiki/Lightness (Last accessed 13 April 2014) |
Examples
>>> munsell_value_priest1920(10.08)
3.1749015...
Returns the Munsell value \(V\) of given luminance \(Y\) using Munsell, Sloan, and Godlove (1933) method.
Parameters: | Y (numeric) – luminance \(Y\). |
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric |
Notes
References
[4] | http://en.wikipedia.org/wiki/Lightness (Last accessed 13 April 2014) |
Examples
>>> munsell_value_munsell1933(10.08)
3.7918355...
Returns the Munsell value \(V\) of given luminance \(Y\) using Moon and Spencer (1943) method.
Parameters: | Y (numeric) – luminance \(Y\). |
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric |
Notes
References
[5] | http://en.wikipedia.org/wiki/Lightness (Last accessed 13 April 2014) |
Examples
>>> munsell_value_moon1943(10.08)
3.7462971...
Returns the Munsell value \(V\) of given luminance \(Y\) using Saunderson and Milner (1944) method.
Parameters: | Y (numeric) – luminance \(Y\). |
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric |
Notes
References
[6] | http://en.wikipedia.org/wiki/Lightness (Last accessed 13 April 2014) |
Examples
>>> munsell_value_saunderson1944(10.08)
3.6865080...
Returns the Munsell value \(V\) of given luminance \(Y\) using Ladd and Pinney (1955) method.
Parameters: | Y (numeric) – luminance \(Y\). |
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric |
Notes
References
[7] | http://en.wikipedia.org/wiki/Lightness (Last accessed 13 April 2014) |
Examples
>>> munsell_value_ladd1955(10.08)
3.6952862...
Returns the Munsell value \(V\) of given luminance \(Y\) using McCamy (1987) method.
Parameters: | Y (numeric) – luminance \(Y\). |
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric |
Notes
References
[8] | Standard Test Method for Specifying Color by the Munsell System - ASTM-D1535-1989, DOI: https://doi.org/10.1520/D1535-13 |
Examples
>>> munsell_value_mccamy1987(10.08)
3.7347235...
Returns the Munsell value \(V\) of given luminance \(Y\) using a reverse lookup table from ASTM D1535-08e1 (2008) method.
Parameters: | Y (numeric) – luminance \(Y\) |
---|---|
Returns: | Munsell value \(V\).. |
Return type: | numeric |
Notes
Examples
>>> munsell_value_ASTM_D1535_08(10.1488096782)
3.7462971...
Supported Munsell value computations methods.
Aliases:
Returns the Munsell value \(V\) of given luminance \(Y\) using given method.
Parameters: |
|
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric |
Notes
Examples
>>> munsell_value(10.08)
3.7344764...
>>> munsell_value(10.08, method='Priest 1920')
3.1749015...
>>> munsell_value(10.08, method='Munsell 1933')
3.7918355...
>>> munsell_value(10.08, method='Moon 1943')
3.7462971...
>>> munsell_value(10.08, method='Saunderson 1944')
3.6865080...
>>> munsell_value(10.08, method='Ladd 1955')
3.6952862...
>>> munsell_value(10.08, method='McCamy 1987')
3.7347235...
Converts given Munsell Colorlab specification to CIE xyY colourspace.
Parameters: | specification (numeric or tuple) – Munsell Colorlab specification. |
---|---|
Returns: | CIE xyY colourspace matrix. |
Return type: | ndarray, (3,) |
Notes
References
[9] | The Munsell and Kubelka-Munk Toolbox: MunsellAndKubelkaMunkToolboxApr2014: MunsellRenotationRoutines/MunsellToxyY.m |
Examples
>>> spc = (2.1, 8.0, 17.9, 4)
>>> munsell_specification_to_xyY(spc)
array([ 0.4400632..., 0.5522428..., 0.5761962...])
>>> munsell_specification_to_xyY(8.9)
array([ 0.31006 , 0.31616 , 0.746134...])
Converts given Munsell colour to CIE xyY colourspace.
Parameters: | munsell_colour (unicode) – Munsell colour. |
---|---|
Returns: | CIE xyY colourspace matrix. |
Return type: | ndarray, (3,) |
Notes
Examples
>>> munsell_colour_to_xyY('4.2YR 8.1/5.3')
array([ 0.3873694..., 0.3575165..., 0.59362 ])
>>> munsell_colour_to_xyY('N8.9')
array([ 0.31006 , 0.31616 , 0.746134...])
Converts from CIE xyY colourspace to Munsell Colorlab specification.
Parameters: | xyY (array_like, (3,)) – CIE xyY colourspace matrix. |
---|---|
Returns: | Munsell Colorlab specification. |
Return type: | numeric or tuple |
Raises: |
|
Notes
References
[10] | The Munsell and Kubelka-Munk Toolbox: MunsellAndKubelkaMunkToolboxApr2014: MunsellRenotationRoutines/xyYtoMunsell.m |
Examples
>>> xyY = np.array([0.38736945, 0.35751656, 0.59362])
>>> xyY_to_munsell_specification(xyY)
(4.1742530..., 8.0999999..., 5.3044360..., 6)
Converts from CIE xyY colourspace to Munsell colour.
Parameters: |
|
---|---|
Returns: | Munsell colour. |
Return type: | unicode |
Notes
Examples
>>> xyY = np.array([0.38736945, 0.35751656, 0.59362])
>>> # Doctests skip for Python 2.x compatibility.
>>> xyY_to_munsell_colour(xyY)
'4.2YR 8.1/5.3'
Parses given Munsell colour and returns an intermediate Munsell Colorlab specification.
Parameters: | munsell_colour (unicode) – Munsell colour. |
---|---|
Returns: | Intermediate Munsell Colorlab specification. |
Return type: | float or tuple |
Raises: | ValueError – If the given specification is not a valid Munsell Renotation System colour specification. |
Examples
>>> parse_munsell_colour('N5.2')
5.2...
>>> parse_munsell_colour('0YR 2.0/4.0')
(0.0, 2.0, 4.0, 6)
Returns if given Munsell Colorlab specification is a single number form used for grey colour.
Parameters: | specification (numeric or tuple) – Munsell Colorlab specification. |
---|---|
Returns: | Is specification a grey colour. |
Return type: | bool |
Examples
>>> is_grey_munsell_colour((0.0, 2.0, 4.0, 6))
False
>>> is_grey_munsell_colour(0.5)
True
Normalises given Munsell Colorlab specification.
Parameters: | specification (numeric or tuple) – Munsell Colorlab specification. |
---|---|
Returns: | Normalised Munsell Colorlab specification. |
Return type: | numeric or tuple |
Examples
>>> normalize_munsell_specification((0.0, 2.0, 4.0, 6))
(10, 2.0, 4.0, 7)
Convenient definition to retrieve a normalised Munsell Colorlab specification from given Munsell colour.
Parameters: | munsell_colour (unicode) – Munsell colour. |
---|---|
Returns: | Normalised Munsell Colorlab specification. |
Return type: | numeric or tuple |
Examples
>>> munsell_colour_to_munsell_specification('N5.2')
5.2...
>>> munsell_colour_to_munsell_specification('0YR 2.0/4.0')
(10, 2.0, 4.0, 7)
Converts from Munsell Colorlab specification to given Munsell colour.
Parameters: |
|
---|---|
Returns: | Munsell colour. |
Return type: | unicode |
Examples
>>> # Doctests skip for Python 2.x compatibility.
>>> munsell_specification_to_munsell_colour(5.2)
'N5.2'
>>> # Doctests skip for Python 2.x compatibility.
>>> spc = (10, 2.0, 4.0, 7)
>>> munsell_specification_to_munsell_colour(spc)
'10.0R 2.0/4.0'
Returns given existing Munsell Colorlab specification CIE xyY colourspace vector from Munsell Renotation System data.
Parameters: | specification (numeric or tuple) – Munsell Colorlab specification. |
---|---|
Returns: | CIE xyY colourspace vector. |
Return type: | tuple |
Raises: | ValueError – If the given specification doesn’t exist in Munsell Renotation System data. |
Examples
>>> xyY_from_renotation((2.5, 0.2, 2.0, 4))
(0.71..., 1.41..., 0.23...)
Returns if given Munsell Colorlab specification is in Munsell Renotation System data.
Parameters: | specification (numeric or tuple) – Munsell Colorlab specification. |
---|---|
Returns: | Is specification in Munsell Renotation System data. |
Return type: | bool |
Examples
>>> is_specification_in_renotation((2.5, 0.2, 2.0, 4))
True
>>> is_specification_in_renotation((64, 0.2, 2.0, 4))
False
Returns for a given hue the two bounding hues from Munsell Renotation System data.
Parameters: |
|
---|---|
Returns: | Bounding hues. |
Return type: | tuple |
References
[11] | The Munsell and Kubelka-Munk Toolbox: MunsellAndKubelkaMunkToolboxApr2014: MunsellSystemRoutines/BoundingRenotationHues.m |
Examples
>>> bounding_hues_from_renotation(3.2, 4)
((2.5, 4), (5.0, 4))
Converts from the Munsell Colorlab specification hue to hue angle in degrees.
Parameters: |
|
---|---|
Returns: | Hue angle in degrees. |
Return type: | numeric |
References
[12] | The Munsell and Kubelka-Munk Toolbox: MunsellAndKubelkaMunkToolboxApr2014: MunsellRenotationRoutines/MunsellHueToChromDiagHueAngle.m |
Examples
>>> hue_to_hue_angle(3.2, 4)
65.5
Converts from hue angle in degrees to the Munsell Colorlab specification hue.
Parameters: | hue_angle (numeric) – Hue angle in degrees. |
---|---|
Returns: | (Munsell Colorlab specification hue, Munsell Colorlab specification code). |
Return type: | tuple |
References
[13] | The Munsell and Kubelka-Munk Toolbox: MunsellAndKubelkaMunkToolboxApr2014: MunsellRenotationRoutines/ChromDiagHueAngleToMunsellHue.m |
Examples
>>> hue_angle_to_hue(65.54)
(3.2160000..., 4)
Converts from the Munsell Colorlab specification hue to ASTM hue number in domain [0, 100].
Parameters: |
|
---|---|
Returns: | ASM hue number. |
Return type: | numeric |
References
[14] | The Munsell and Kubelka-Munk Toolbox: MunsellAndKubelkaMunkToolboxApr2014: MunsellRenotationRoutines/MunsellHueToASTMHue.m |
Examples
>>> hue_to_ASTM_hue(3.2, 4)
33.2...
Returns whether to use linear or radial interpolation when drawing ovoids through data points in the Munsell Renotation System data from given specification.
Parameters: | specification (numeric or tuple) – Munsell Colorlab specification. |
---|---|
Returns: | Interpolation method. |
Return type: | unicode or None (‘Linear’, ‘Radial’, None) |
Notes
References
[15] | The Munsell and Kubelka-Munk Toolbox: MunsellAndKubelkaMunkToolboxApr2014: MunsellSystemRoutines/LinearVsRadialInterpOnRenotationOvoid.m |
Examples
>>> spc = (2.5, 5.0, 12.0, 4)
>>> # Doctests skip for Python 2.x compatibility.
>>> interpolation_method_from_renotation_ovoid()
'Radial'
Converts given Munsell Colorlab specification to xy chromaticity coordinates on Munsell Renotation System ovoid. The xy point will be on the ovoid about the achromatic point, corresponding to the Munsell Colorlab specification value and chroma.
Parameters: | specification (numeric or tuple) – Munsell Colorlab specification. |
---|---|
Returns: | xy chromaticity coordinates. |
Return type: | tuple |
Raises: | ValueError – If an invalid interpolation method is retrieved from internal computations. |
Notes
References
[16] | The Munsell and Kubelka-Munk Toolbox: MunsellAndKubelkaMunkToolboxApr2014: MunsellRenotationRoutines/FindHueOnRenotationOvoid.m |
Examples
>>> xy_from_renotation_ovoid((2.5, 5.0, 12.0, 4))
(0.4333..., 0.5602...)
>>> xy_from_renotation_ovoid(8)
(0.31006, 0.31616)
Converts from CIE LCHab colourspace to approximate Munsell Colorlab specification.
Parameters: | LCHab (array_like, (3,)) – CIE LCHab colourspace matrix. |
---|---|
Returns: | Munsell Colorlab specification. |
Return type: | tuple |
Notes
References
[17] | The Munsell and Kubelka-Munk Toolbox: MunsellAndKubelkaMunkToolboxApr2014: GeneralRoutines/CIELABtoApproxMunsellSpec.m |
Examples
>>> LCHab = np.array([100, 17.50664796, 244.93046842])
>>> LCHab_to_munsell_specification(LCHab)
(8.0362412..., 10.0, 3.5013295..., 1)
Returns the maximum Munsell chroma from Munsell Renotation System data using given Munsell Colorlab specification hue, Munsell Colorlab specification value and Munsell Colorlab specification code.
Parameters: |
|
---|---|
Returns: | Maximum chroma. |
Return type: | numeric |
References
[18] | The Munsell and Kubelka-Munk Toolbox: MunsellAndKubelkaMunkToolboxApr2014: MunsellRenotationRoutines/MaxChromaForExtrapolatedRenotation.m |
Examples
>>> maximum_chroma_from_renotation(2.5, 5, 5)
14.0
Converts given Munsell Colorlab specification to xy chromaticity coordinates by interpolating over Munsell Renotation System data.
Parameters: | specification (numeric or tuple) – Munsell Colorlab specification. |
---|---|
Returns: | xy chromaticity coordinates. |
Return type: | tuple |
Notes
References
[19] | The Munsell and Kubelka-Munk Toolbox: MunsellAndKubelkaMunkToolboxApr2014: MunsellRenotationRoutines/MunsellToxyForIntegerMunsellValue.m |
Examples
>>> # Doctests ellipsis for Python 2.x compatibility.
>>> munsell_specification_to_xy((2.1, 8.0, 17.9, 4))
(0.440063..., 0.552242...)
>>> munsell_specification_to_xy(8)
(0.31006..., 0.31616...)