MunsellTosRGB {munsellinterpol} | R Documentation |
Convert a Munsell specification to sRGB coordinates
Description
MunsellTosRGB
Converts a
Munsell specification to non-linear sRGB coordinates, by interpolating over the
extrapolated Munsell renotation data
Usage
MunsellTosRGB( MunsellSpec, maxSignal=255, ... )
Arguments
MunsellSpec |
a numeric Nx3 matrix with HVC values in the rows, or a vector that can be converted to such a matrix, by row. |
maxSignal |
maximum of signal sRGB; Other popular values are 1, 100, 1023, and 65535 |
... |
other parameters passed to |
Details
The conversion is done in these steps.
HVC → xyY using
MunsellToxyY()
and the given...
. This xyY is for Illuminant C.xyY → XYZ using
spacesXYZ::XYZfromxyY()
XYZ is adapted from Illuminant C to Illuminant D65 (from the sRGB standard) using
spacesXYZ::adaptXYZ()
and the Bradford chromatic adaptation methodXYZ → sRGB using
spacesRGB::RGBfromXYZ()
with the givenmaxSignal
Value
a data.frame
with these columns:
SAMPLE_NAME |
the original |
xyY |
an Nx3 matrix with xyY values in the rows, that are adapted to Illuminant C.
This is an intermediate result that is sometimes useful, e.g. it can be passed
to |
RGB |
an Nx3 matrix with non-linear signal sRGB values in the rows.
All values are clamped to the appropriate cube, e.g. |
OutOfGamut |
logical vector, TRUE means the RGB result was out of gamut (the cube) before clamping it |
Note
The more general function MunsellToRGB()
also performs this conversion.
The main reason to use MunsellTosRGB()
is that it takes a little less time,
since the CAT (using the Bradford method) is precomputed during
base::.onLoad()
.
Author(s)
Jose Gama and Glenn Davis
References
Paul Centore 2014 The Munsell and Kubelka-Munk Toolbox https://www.munsellcolourscienceforpainters.com/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html
See Also
MunsellToXYZ()
,
MunsellToRGB()
,
spacesXYZ::XYZfromxyY()
,
spacesXYZ::CAT()
,
spacesXYZ::adaptXYZ()
,
spacesRGB::RGBfromXYZ()
,
IsWithinMacAdamLimits()
Examples
MunsellTosRGB( c('7.6P 8.9/2.2', 'N 3/') )
## SAMPLE_NAME xyY.x xyY.y xyY.Y RGB.R RGB.G RGB.B OutOfGamut
## 1 7.6P 8.9/2.2 0.3109520 0.3068719 74.6134498 231.35746 221.14207 230.35011 FALSE
## 2 N 3/ 0.3101000 0.3163000 6.3911778 71.50491 71.50491 71.50491 FALSE