[R] bizarre color space conversion problem

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Thu Jul 18 17:02:45 CEST 2019


This is, indeed, bizzare!

On Thu, 18 Jul 2019 10:35:57 -0400
Sarah Goslee <sarah.goslee using gmail.com> wrote:

> I've gotten as far as locating the problem in this line from
> grDevices::convertColor()
> 
>     xyz <- from$toXYZ(color, from.ref.white)

So if you manually feed the arguments:

Lab <- structure(c(53.484183785248, 53.484183785248, 53.484183785248,
53.484183785248, 53.484183785248, 53.484183785248, 53.484183785248,
53.484183785248, 53.484183785248, 53.484183785248, 53.484183785248,
53.484183785248, 53.484183785248, 53.484183785248, 53.484183785248,
53.484183785248, 53.484183785248, 53.484183785248, 53.484183785248,
53.484183785248, 80.0102716478952, 80.0102716478952, 80.0102716478952,
80.0102716478952, 80.0102716478952, 80.0102716478952, 80.0102716478952,
80.0102716478952, 80.0102716478952, 80.0102716478952, 80.0102716478952,
80.0102716478952, 80.0102716478952, 80.0102716478952, 80.0102716478952,
80.0102716478952, 80.0102716478952, 80.0102716478952, 80.0102716478952,
80.0102716478952, 67.3840746825475, 67.3840746825475, 67.3840746825475,
67.3840746825475, 67.3840746825475, 67.3840746825475, 67.3840746825475,
67.3840746825475, 67.3840746825475, 67.3840746825475, 67.3840746825475,
67.3840746825475, 67.3840746825475, 67.3840746825475, 67.3840746825475,
67.3840746825475, 67.3840746825475, 67.3840746825475, 67.3840746825475,
67.3840746825475), .Dim = c(20L, 3L), .Dimnames = list(NULL, c("L",
"a", "b")))
white <- c(x = 0.953205712549377, 1, y = 1.08538438164692)

to the function:

grDevices::colorspaces[['Lab']][['toXYZ']](Lab, white)

Do you get the same result on all three computers?

If you debugonce(grDevices::colorspaces[['Lab']][['toXYZ']]), then
try to convertColor(red.lab, from = "Lab", to = "sRGB"), are the
arguments Lab and white the same on all three computers?

-- 
Best regards,
Ivan



More information about the R-help mailing list