Learn R Programming

munsellinterpol (version 3.0-0)

MunsellToxyY: Convert Munsell HVC to xyY coordinates

Description

MunsellToxyY Converts Munsell HVC to xyY coordinates, by interpolating over the extrapolated Munsell renotation data

Usage

MunsellToxyY( MunsellSpec, xyC='NBS', hcinterp='bicubic', vinterp='cubic',
                     YfromV='ASTM', warn=TRUE )

Arguments

MunsellSpec

a numeric Nx3 matrix or a vector that can be converted to such a matrix. Each row has Munsell HVC, where H is Hue Number, and V and C are the standard Munsell Value and Chroma. The Hue is automatically wrapped to the interval (0,100]. MunsellSpec can also be a character N-vector with standard Munsell notation; it is converted to an Nx3 matrix.

xyC

a numeric 2-vector with xy chromaticity of Illuminant C. It can also be one of the strings in the first column of this table; it is then replaced by the corresponding xy in the second column.

xy white point reference
'NBS' c(0.3101,0.3163) Kelly, et. al. [RP1549] (1943). Rheinboldt et al. (1960)
'JOSA' c(0.31012,0.31631) Judd, Deane B. (1933)
'NTSC' c(0.310,0.316) NTSC (1953)
'CIE' c(0.31006,0.31616) CIE:15 2004

The default 'NBS' is probably what is intended by Newhall et. al. although no xy for C appears in that paper. This is the C used in the first computer program for conversion: Rheinboldt et al. (1960). The other options are provided so that a neutral Munsell chip has the xy that the user expects. Alternative values of xyC should not be too far from the above. If hcinterp is 'bicubic', this parameter only affects chips with Chroma \(<\) 4 (except Chroma=2). If hcinterp is 'bilinear', this parameter only affects chips with Chroma \(<\) 2.

hcinterp

either 'bicubic' or 'bilinear' (partial matching enabled). In the bicubic case, for a general input point, the output value is interpolated using a 4x4 subgrid of the lookup table, and the interpolation function is class \(C^1\) (except at the neutrals). In the bilinear case, the interpolation uses a 2x2 subgrid, and the function is class \(C^0\).

vinterp

either 'cubic' or 'linear' (partial matching enabled). In the cubic case, for a general input point, the output value is interpolated using 4 planes of constant Value, and the interpolation function is class \(C^1\). In the linear case, the interpolation uses 2 planes and the function is class \(C^0\).

YfromV

passed as the parameter which to the function YfromV(). See YfromV() for details. Option 'MGO' is not allowed because then Y>100 when V=10.

warn

if a chip cannot be mapped (usually because the Chroma is too large), its x and y are set to NA in the returned data.frame. Just before returning, if any rows have NA, and this argument is TRUE, then a warning is logged.

Value

a data.frame with these columns:

SAMPLE_NAME

the original MunsellSpec if that was a character vector. Or the Munsell notation string converted from the input matrix HVC.

HVC

the input Nx3 matrix, or the HVC matrix converted from the input Munsell notation

xyY

the computed output matrix, with CIE xyY coordinates of MunsellSpec illuminated by Illuminant C. In case of error, x and y are set to NA. The rownames of xyY are set to those of HVC, unless they are NULL when they are set to SAMPLE_NAME.

Warning

Even when vinterp='cubic' the function HVC xyY is not \(C^1\) on the plane V=1. This is because of a change in Value spacing: when V\(\ge\)1 the Value spacing is 1, but when V\(\le\)1 the Value spacing is 0.2.

Details

In case hcinterp='bicubic' or vinterp='cubic' a Catmull-Rom spline is used; see the article Cubic Hermite spline. This spline has the nice property that it is local and requires at most 4 points. And if the knot spacing is uniform: 1) the resulting spline is \(C^1\), 2) if the knots are on a line, the interpolated points are on the line too.

References

Judd, Deane B. The 1931 I.C.I. Standard Observer and Coordinate System for Colorimetry. Journal of the Optical Society of America. Vol. 23. pp. 359-374. October 1933.

Newhall, Sidney M., Dorothy Nickerson, Deane B. Judd. Final Report of the O.S.A. Subcommitte on the Spacing of the Munsell Colors. Journal of the Optical Society of America. Vol. 33. No. 7. pp. 385-418. July 1943.

Kelly, Kenneth L. Kasson S. Gibson. Dorothy Nickerson. Tristimulus Specification of the Munsell Book of Color from Spectrophometric Measurements National Bureau of Standards RP1549 Volume 31. August 1943.

Judd, Deane B. and G<U+00FC>nther Wyszecki. Extension of the Munsell Renotation System to Very Dark Colors. Journal of the Optical Society of America. Vol. 46. No. 4. pp. 281-284. April 1956.

National Television System Committee. [Report and Reports of Panel No. 11, 11-A, 12-19, with Some supplementary references cited in the Reports, and the Petition for adoption of transmission standards for color television before the Federal Communications Commission] (1953)

Rheinboldt, Werner C. and John P. Menard. Mechanized Conversion of Colorimetric Data to Munsell Renotations. Journal of the Optical Society of America. Vol. 50, Issue 8, pp. 802-807. August 1960.

Wikipedia. Cubic Hermite spline. https://en.wikipedia.org/wiki/Cubic_Hermite_spline

Paul Centore 2014 The Munsell and Kubelka-Munk Toolbox https://www.munsellcolourscienceforpainters.com/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html

See Also

xyYtoMunsell()

Examples

Run this code
# NOT RUN {
MunsellToxyY( '7.6P 8.9/2.2' )
##    SAMPLE_NAME  HVC.H HVC.V HVC.C      xyY.x      xyY.y      xyY.Y
##  1 7.6P 8.9/2.2  87.6   8.9   2.2  0.3109520  0.3068719 74.6134498
# }

Run the code above in your browser using DataLab