[R] grDevices::convertColor XYZ space is it really xyY?

Bryan Hanson hanson at depauw.edu
Wed Jun 12 22:20:56 CEST 2013

Ken, I followed your suggestion and perhaps I don't understand what to expect from convertColor or maybe I'm not using it correctly.  Consider the following tests:

D65 <- c(0.3127, 0.329, 0.3583) # D65 chromaticity coordinates
X <- D65[1]*D65[3]/D65[2] # conversion per brucelindbloom.com
Y <- D65[3]
Z <- D65[3]*D65[3]/D65[2]
XYZ <- data.frame(X = X, Y = Y, Z = Z) # D65 in tristimulus values (?)
colnames(XYZ) <- c("X", "Y", "Z")

tst1 <- convertColor(XYZ, from = "XYZ", to = "sRGB")
tst2 <- convertColor(D65, from = "XYZ", to = "sRGB")
# none of these are 1,1,1, namely white (they are ~ 0.6, 0.6, 0.6)

So it looks like D65, a white standard, does not come back to something near white in the sRGB space.  What am I doing wrong here, or what do I misunderstand?  Please don't say everything!

Thanks, Bryan

On Jun 12, 2013, at 2:57 PM, Ken Knonlauch <ken.knoblauch at inserm.fr> wrote:

> Bryan Hanson <hanson <at> depauw.edu> writes:
>> grDevices::convertColor has arguments 'from' and 'to' which can 
> take on value 'XYZ'.  Can 
> someone confirm
>> that 'XYZ' is the same as the CIE chromaticity coordinates 
> are also sometimes refered to 
> as 'xyY' in
>> the literature?  Or are these the CIE tristimulus values?  
> It looks to me like the first case is 
> true, but I
>> would appreciate hearing from one of the people in 
> know.  Thanks, Bryan
> I.'d look at the code or put in some known data to test it, 
> but XYZ are tristimulus values and xyY are chromaticity
> coordinated and the luminance which is the Y tristimulus
> value for the CIE 1931 standard observer.
> Ken
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list