Signal RGB Calculation | R Documentation |
Calculate signal RGB from linear RGB, XYZ, or Lab
SignalRGBfromLinearRGB( RGB, space='sRGB', which='scene', TF=NULL, maxSignal=1 )
RGBfromXYZ( XYZ, space='sRGB', which='scene', TF=NULL, maxSignal=1 )
RGBfromLab( Lab, space='sRGB', which='scene', TF=NULL, maxSignal=1 )
RGB |
a numeric Nx3 matrix with linear RGB coordinates in the rows, or a vector that can be converted to such a matrix, by row. The RGB may be outside the corresponding domain box (either scene or display), see Details. |
XYZ |
a numeric Nx3 matrix with CIE XYZ coordinates in the rows, or a vector that can be converted to such a matrix, by row.
The XYZ are assumed to be viewed under the white-point of the given RGB |
Lab |
a numeric Nx3 matrix with CIE Lab coordinates in the rows, or a vector that can be converted to such a matrix, by row. |
space |
the name of an installed RGB space. The name matching is partial and case-insensitive. |
which |
either |
TF |
if not |
maxSignal |
maximum value of non-linear |
In RGBfromXYZ()
, the conversion is done in these steps:
XYZ \rarrow linear RGB using the 3x3 matrix for the given space
and which
if TF
is not the identity, the linear RGBs are clamped to [0,1]^3
if necessary
linear RGB \rarrow signal RGB using SignalRGBfromLinearRGB()
and all other the given arguments
In RGBfromLab()
, Lab \rarrow XYZ
is calculated using
spacesXYZ::XYZfromLab()
,
with the white point
(either 'scene'
or 'display'
) of the given RGB space.
a data.frame
with N rows and these columns
RGB |
signal RGB.
If |
OutOfGamut |
a logical, TRUE means one or more of the computed linear RGBs were actually clamped to [0,1]. |
In RGBfromLab()
, if a=b=0 exactly, the R=G=B exactly.
In case of error, the functions return NULL.
Wikipedia. RGB color space. https://en.wikipedia.org/wiki/RGB_color_space
XYZfromRGB()
,
LinearRGBfromSignalRGB()
,
installRGB()
,
identity.TF
,
spacesXYZ::XYZfromLab()
RGBfromXYZ( c(80.310897,90.306510,84.613450, 100,100,100)/100, max=255 )
## RGB.R RGB.G RGB.B OutOfGamut
## 1 230.1676 249.4122 225.2472 FALSE
## 2 255.0000 249.1125 244.4704 TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.