Learn R Programming

munsellinterpol (version 2.0.1)

srgb2xyz: Convert sRGB coordinates to XYZ

Description

Convert sRGB coordinates to XYZ

Usage

srgb2xyz( RGBmatrix, maxValue=255 )

Arguments

RGBmatrix

a numeric Nx3 matrix with sRGB coordinates in the rows, or a vector that can be converted to such a matrix, by row. These are non-linear display values, but they are not required to be integers.

maxValue

maximum value of sRGB for display. Other popular values are 1, 1023, and 65535. Even when 1, they are still taken to be non-linear display values.

Value

a numeric Nx3 matrix with XYZ coordinates in the rows. These are for viewing under Illuminant D65 (from the sRGB standard), with Y=100.

References

Wikipedia. sRGB. https://en.wikipedia.org/wiki/SRGB.

Logicol S.r.l., 2014 EasyRGB color search engine http://www.easyrgb.com/

See Also

xyz2srgb()

Examples

Run this code
# NOT RUN {
srgb2xyz( c(128,200,255, 0,0,0,  255,255,255) )
##              X         Y        Z
##  [1,] 47.60334  53.11601 102.3549
##  [2,]  0.00000   0.00000   0.0000
##  [3,] 95.04559 100.00000 108.9058
# }

Run the code above in your browser using DataLab