Skip to content

spacesXYZ

CIE XYZ and some of Its Derived Color Spaces

v1.6-0 · Jun 5, 2025 · GPL (>= 3)

Description

Functions for converting among CIE XYZ, xyY, Lab, and Luv. Calculate Correlated Color Temperature (CCT) and the Planckian and daylight loci. The XYZs of some standard illuminants and some standard linear chromatic adaptation transforms (CATs) are included. Three standard color difference metrics are included, plus the forward direction of the 'CIECAM02' color appearance model.

Downloads

20.5K

Last 30 days

785th

20.5K

Last 90 days

20.5K

Last year

CRAN Check Status

1 ERROR
2 NOTE
11 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang NOTE
r-devel-linux-x86_64-debian-gcc NOTE
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 ERROR
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK
Check details (14 non-OK)
NOTE r-devel-linux-x86_64-debian-clang

CRAN incoming feasibility

Maintainer: ‘Glenn Davis <gdavis@gluonics.com>’

Found the following (possibly) invalid file URI:
  URI: <gdavis@gluonics.com>
    From: inst/doc/isotherms.pdf
NOTE r-devel-linux-x86_64-debian-gcc

CRAN incoming feasibility

Maintainer: ‘Glenn Davis <gdavis@gluonics.com>’

Found the following (possibly) invalid file URI:
  URI: <gdavis@gluonics.com>
    From: inst/doc/isotherms.pdf
OK r-devel-linux-x86_64-fedora-clang

*


            
OK r-devel-linux-x86_64-fedora-gcc

*


            
ERROR r-devel-macos-arm64

tests

  Running ‘test-CCT.R’ [0s/0s]
  Running ‘test-DeltaE.R’ [0s/0s]
  Running ‘test-adaptations.R’ [0s/0s]
Running the tests in ‘tests/test-adaptations.R’ failed.
Complete output:
  > 
  > 
  > library( spacesXYZ )
  Attaching spacesXYZ.  Version: 1.6-0.  Author: Glenn Davis [aut, cre].  Built: R 4.6.0; ; 2026-02-13 01:57:50 UTC; unix
  > 
  > options( width=144 )
  >     
  > printf <- function( msg, ... )
  +     {    
  +     mess = sprintf( msg[1], ... )    # should this really be msg[1] ?
  +     cat( mess, '\n' )   #, file=stderr() )
  +     }
  >     
  > 
  > testFundamental <- function()
  +     {
  +     printf( "\n---------------------  testFundamental()  -----------------------" )
  + 
  +     C   = standardXYZ( 'C' )
  +     D65 = standardXYZ( 'D65' )
  +     
  +     #  xyY_D65     = xyYfromXYZ( D65 )    
  +     
  +     for( method in c( "Bradford", "VonKries", "MCAT02", "Bianco", "scaling" ) )
  +         {
  +         CtoD65  = CAT( C, D65, method=method )
  + 
  +         xyY_gray    = xyYfromXYZ( adaptXYZ(CtoD65,C) )
  +         
  +         delta   = max( abs(adaptXYZ(CtoD65,C) - D65)  )
  +         
  +         printf( "method='%s'.  delta=%g", method, delta )
  +         
  +         if( 5.e-16 < delta )
  +             {
  +             printf( "Adaptation accuracy failed for method='%s'.  delta=%g", method, delta )
  +             return(FALSE)
  +             }        
  +         }
  + 
  +     return( TRUE )
  +     }
  >     
  >         
  >     
  > testSymmetry <- function()
  +     {
  +     printf( "\n---------------------  testSymmetry()  -----------------------" )
  + 
  +     I3  = diag(3)
  +     
  +     for( method in c( "Bradford", "VonKries", "MCAT02", "Bianco", "scaling" ) )
  +         {
  +         AtoB    = CAT( 'A', 'B', method=method )
  +         
  +         BtoA    = CAT( 'B', 'A', method=method )
  +         
  +         #   the product of the Ms must be I
  +         delta   = max( abs(AtoB$M %*% BtoA$M  -  I3) )   #        print(delta)
  +         
  +         printf( "method='%s'.  delta=%g", method, delta )
  +                 
  +         if( 5.e-15 < delta )
  +             {
  +             printf( "Adaptation symmetry failed for method='%s'.  delta=%g", method, delta )
  +             return(FALSE)
  +             }
  +         }
  + 
  +     return( TRUE )
  +     }
  >     
  >     
  > testCommutativity <- function()
  +     {
  +     printf( "\n---------------  testCommutativity()  -----------------------" )
  + 
  +     for( method in c( "Bradford", "VonKries", "MCAT02", "Bianco", "scaling" ) )
  +         {
  +         AtoB    = CAT( 'A', 'B', method=method )
  +         
  +         BtoC    = CAT( 'B', 'C', method=method )
  +         
  +         AtoC    = CAT( 'A', 'C', method=method )        
  +         
  +         #   compare matrix product
  +         delta   = max( abs(BtoC$M %*% AtoB$M  -  AtoC$M) )   
  +         
  +         printf( "method='%s'.  delta=%g", method, delta )
  +         
  +         if( 5.e-15 < delta )
  +             {
  +             printf( "Adaptation commutativity failed for method='%s'.  delta=%g", method, delta )
  +             return(FALSE)
  +             }
  +         }
  + 
  +     return( TRUE )
  +     }
  >     
  >     
  >     
  > if( ! testFundamental() )   stop( "testFundamental() failed !", call.=FALSE )
  
  ---------------------  testFundamental()  ----------------------- 
  method='Bradford'.  delta=2.22045e-16 
  method='VonKries'.  delta=5.55112e-16 
  Adaptation accuracy failed for method='VonKries'.  delta=5.55112e-16 
  Error: testFundamental() failed !
  Execution halted
OK r-devel-windows-x86_64

*


            
OK r-oldrel-macos-arm64

*


            
OK r-oldrel-macos-x86_64

*


            
OK r-oldrel-windows-x86_64

*


            
OK r-patched-linux-x86_64

*


            
OK r-release-linux-x86_64

*


            
OK r-release-macos-arm64

*


            
OK r-release-macos-x86_64

*


            
OK r-release-windows-x86_64

*


            

Check History

ERROR 11 OK · 2 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 9, 2026
NOTE r-devel-linux-x86_64-debian-clang

CRAN incoming feasibility

Maintainer: ‘Glenn Davis <gdavis@gluonics.com>’

Found the following (possibly) invalid file URI:
  URI: <gdavis@gluonics.com>
    From: inst/doc/isotherms.pdf
NOTE r-devel-linux-x86_64-debian-gcc

CRAN incoming feasibility

Maintainer: ‘Glenn Davis <gdavis@gluonics.com>’

Found the following (possibly) invalid file URI:
  URI: <gdavis@gluonics.com>
    From: inst/doc/isotherms.pdf
ERROR r-devel-macos-arm64

tests

  Running ‘test-CCT.R’ [0s/0s]
  Running ‘test-DeltaE.R’ [0s/0s]
  Running ‘test-adaptations.R’ [0s/0s]
Running the tests in ‘tests/test-adaptations.R’ failed.
Complete output:
  > 
  > 
  > library( spacesXYZ )
  Attaching spacesXYZ.  Version: 1.6-0.  Author: Glenn Davis [aut, cre].  Built: R 4.6.0; ; 2026-02-13 01:57:50 UTC; unix
  > 
  > options( width=144 )
  >     
  > printf <- function( msg, ... )
  +     {    
  +     mess = sprintf( msg[1], ... )    # should this really be msg[1] ?
  + 

Reverse Dependencies (9)

Dependency Network

Dependencies Reverse dependencies logger Spectran colorblindcheck cols4all munsellinterpol wal colorSpec khroma photobiologyInOut spacesRGB spacesXYZ

Version History

new 1.6-0 Mar 10, 2026