Defines various objects for Munsell Renotation System computations:
References
[1] | (1, 2, 3) Centore, P. (n.d.). Munsell Resources. Retrieved July 26, 2014, from http://www.99main.com/~centore/MunsellResources/MunsellResources.html |
[2] | (1, 2, 3) Centore, P. (2012). An open-source inversion algorithm for the Munsell renotation. Color Research & Application, 37(6), 455–464. doi:10.1002/col.20715 |
Returns the Munsell value \(V\) of given luminance \(Y\) using Priest, Gibson and MacNicholas (1920) method.
Parameters: | Y (numeric or array_like) – luminance \(Y\). |
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric or ndarray |
Notes
References
[3] | (1, 2, 3, 4) Wikipedia. (n.d.). Lightness. Retrieved April 13, 2014, from http://en.wikipedia.org/wiki/Lightness |
Examples
>>> munsell_value_Priest1920(10.08)
3.1749015...
Returns the Munsell value \(V\) of given luminance \(Y\) using Munsell, Sloan and Godlove (1933) method. [3]
Parameters: | Y (numeric or array_like) – luminance \(Y\). |
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric or ndarray |
Notes
Examples
>>> munsell_value_Munsell1933(10.08)
3.7918355...
Returns the Munsell value \(V\) of given luminance \(Y\) using Moon and Spencer (1943) method. [3]
Parameters: | Y (numeric or array_like) – luminance \(Y\). |
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric or ndarray |
Notes
Examples
>>> munsell_value_Moon1943(10.08)
3.7462971...
Returns the Munsell value \(V\) of given luminance \(Y\) using Saunderson and Milner (1944) method. [3]
Parameters: | Y (numeric) – luminance \(Y\). |
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric |
Notes
Examples
>>> munsell_value_Saunderson1944(10.08)
3.6865080...
Returns the Munsell value \(V\) of given luminance \(Y\) using Ladd and Pinney (1955) method. [3]
Parameters: | Y (numeric or array_like) – luminance \(Y\). |
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric or ndarray |
Notes
Examples
>>> munsell_value_Ladd1955(10.08)
3.6952862...
Returns the Munsell value \(V\) of given luminance \(Y\) using McCamy (1987) method.
Parameters: | Y (numeric or array_like) – luminance \(Y\). |
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric or ndarray |
Notes
References
[4] | ASTM International. (1989). ASTM D1535-89 Standard Test Method for Specifying Color by the Munsell System. Retrieved from http://www.astm.org/DATABASE.CART/HISTORICAL/D1535-89.htm |
Examples
>>> munsell_value_McCamy1987(10.08)
array(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 or array_like) – luminance \(Y\) |
---|---|
Returns: | Munsell value \(V\). |
Return type: | numeric or ndarray |
Notes
Examples
>>> munsell_value_ASTMD153508(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 or ndarray |
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')
array(3.7347235...)
Converts given Munsell Colorlab specification to CIE xyY colourspace.
Parameters: | specification (numeric or tuple) – Munsell Colorlab specification. |
---|---|
Returns: | CIE xyY colourspace array. |
Return type: | ndarray, (3,) |
Notes
References
[5] | Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellToxyY.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox |
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 array. |
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 array. |
---|---|
Returns: | Munsell Colorlab specification. |
Return type: | numeric or tuple |
Raises: |
|
Notes
References
[6] | Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/xyYtoMunsell.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox |
Examples
>>> xyY = np.array([0.38736945, 0.35751656, 0.59362000])
>>> 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.59362000])
>>> # 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
[7] | Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellSystemRoutines/BoundingRenotationHues.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox |
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
[8] | Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellHueToChromDiagHueAngle.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox |
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
[9] | Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/ChromDiagHueAngleToMunsellHue.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox |
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
[10] | Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellHueToASTMHue.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox |
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
[11] | Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellSystemRoutines/LinearVsRadialInterpOnRenotationOvoid.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox |
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
[12] | Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/FindHueOnRenotationOvoid.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox |
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 array. |
---|---|
Returns: | Munsell Colorlab specification. |
Return type: | tuple |
Notes
References
[13] | Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - GeneralRoutines/CIELABtoApproxMunsellSpec.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox |
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
[14] | Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MaxChromaForExtrapolatedRenotation.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox |
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
[15] | Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellToxyForIntegerMunsellValue.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox |
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...)