Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

xyYtoMunsell

Convert xyY coordinates into a Munsell specification


Description

xyYtoMunsell Converts xyY coordinates into a Munsell specification, by interpolating over the extrapolated Munsell renotation data

Usage

xyYtoMunsell( xyY, xyC='NBS', hcinterp='bicubic', vinterp='cubic',
                     VfromY='ASTM', warn=TRUE, perf=FALSE )

Arguments

xyY

a numeric Nx3 matrix with CIE xyY coordinates in the rows, or a vector that can be converted to such a matrix, by row. These are for viewing in an environment with Illuminant C, with Y=100.

xyC

a numeric 2-vector with xy chromaticity of Illuminant C. It can also be one of the strings given in MunsellToxyY().

hcinterp

either 'bicubic' or 'bilinear' (partial matching enabled). See MunsellToxyY() for details.

vinterp

either 'cubic' or 'linear' (partial matching enabled). See MunsellToxyY() for details.

VfromY

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

warn

if an xyY cannot be mapped (usually because the root finder has wandered afar), its H and V 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.

perf

if perf is TRUE, then extra performance related metrics are appended to the returned data.frame, see Value.

Details

See MunsellToxyY() and the User Guide - Appendix C.

Value

a data.frame with N rows and these columns:

xyY

The input xyY

HVC

the computed HVC. H is automatically wrapped to (0,100]. In case of failure, H and C are NA.

SAMPLE_NAME

a character vector - the Munsell notation for HVC

If perf is TRUE then there are these additional columns:

time.elapsed

elapsed time in seconds. If available, the function microbenchmark::get_nanotime() is used.

iterations

the number of iterations of rootSolve::multiroot()

evalations

the number of forward (HVC → xyY) function evaluations

estim.precis

the estimated precision from rootSolve::multiroot(). This is in the HC plane for the Munsell Value easily computed from Y.

If the rownames of xyY are not NULL and have no duplicates, they are copied to the returned data frame.

Warning

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

Author(s)

Jose Gama and Glenn Davis

Source

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ü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.

See Also

Examples

xyYtoMunsell(c(0.310897, 0.306510, 74.613450))
##       xyY.1     xyY.2     xyY.3     HVC.H     HVC.V     HVC.C    SAMPLE_NAME
## 1  0.310897  0.306510 74.613450 87.541720  8.900000  2.247428 7.5P 8.9/2.2

munsellinterpol

Interpolate Munsell Renotation Data from Hue/Chroma to CIE/RGB

v2.6-1
GPL (>= 3)
Authors
Jose Gama [aut, trl], Paul Centore [aut, cph], Glenn Davis [aut, cre]
Initial release
2020-02-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.