Learn R Programming

spacesXYZ (version 1.3-0)

toXYZ: Convert other Color Spaces to XYZ

Description

Convert other Color Spaces to XYZ

Usage

XYZfromxyY( xyY ) 
XYZfromLab( Lab, white ) 
XYZfromLuv( Luv, white )

Value

a numeric Nx3 matrix with XYZ coordinates in the rows. The rownames are copied from input to output.

In XYZfromxyY() if y==0 then X and Z are set to NA. Exception: Y==0 is treated as a special case (pure black); x and y are ignored, and XYZ are all set to 0.

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.

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.

Luv

a numeric Nx3 matrix with CIE Luv coordinates in the rows, or a vector that can be converted to such a matrix, by row.

white

a numeric 3-vector giving the XYZ of reference white. white can also be a character string with the name of a standard illuminant, which is passed to standardXYZ() to get the XYZ.

References

Wikipedia. CIE 1931 color space. https://en.wikipedia.org/wiki/CIE_1931_color_space

See Also

standardXYZ()

Examples

Run this code
XYZfromxyY(c(0.310897, 0.306510, 74.613450))
##              X        Y        Z
##  [1,] 75.68137 74.61345 93.13427


XYZfromLab( c(50,2,-3), 'D50' )
##               X         Y         Z
##  [1,] 0.1813684 0.1841865 0.1643335

Run the code above in your browser using DataLab