Adapt XYZ or xyY from a source viewing enviroment with a given illuminant, to a destination viewing environment with a different illuminant
adaptXYZ( XYZ.src, white.src, white.dest, method="bradford" )
adaptxyY( xyY.src, white.src, white.dest, method="bradford" )
an Nx3 matrix, or a vector that can be converted to such a matrix, by rows. Each row has an XYZ in the source viewing environment.
an Nx3 matrix, or a vector that can be converted to such a matrix, by rows. Each row has an xyY in the source viewing environment.
the XYZ or xyY of the illuminant in the source viewing environment
the XYZ or xyY of the illuminant in the destination viewing environment
the method used for the chromatic adaption. Available methods are:
"Bradford"
, "VonKries"
, "MCAT02"
, and "scaling"
.
See References.
Partial matching is enabled, and matching is case-insensitive.
adaptXYZ()
returns an Nx3 matrix with adapted XYZ in each row.
adaptxyY()
returns an Nx3 matrix with adapted xyY in each row.
Chromatic adaption can be viewed as an Aristotelian analogy of proportions. A general analogy of this type is usually written A:B = C:D and read as "A is to B as C is to D". In our case the expression A:I is read as "the appearance of A in a viewing environment with illuminant I", or more simply "the appearance of A under illuminant I". It is better to think of A not as an object color, but as a self-luminous color. The analogy \(A:I = B:J\) can be read as "the appearance of \(A\) under illuminant \(I\) is the same as the appearance of \(B\) under illuminant \(J\)".
Solving this problem of chromatic adaption is solving this analogy for X: A:I = X:J, where I is the the source illuminant and J is the destination illuminant.
adaptXYZ()
is the more fundamental of the two.
adaptxyY()
simply calls adaptXYZ()
using
xyY2XYZ()
and XYZ2xyY()
to do conversions.
However, adaptxyY()
does do an addition check:
if the chromaticity of a row in xyY.src
exactly matches that of white.src
,
then the returned chromaticity is set to be exactly the same as that in white.dest
. Because of numerical truncation, it might not be.
In adaptXYZ()
the white
coordinates are XYZ
.
In adaptxyY()
the white
coordinates are xyY
.
Hunt, R. W. G. The Reproduction of Colour. 6th Edition. John Wiley & Sons. 2004.
International Color Consortium. ICC.1:2001-04. File Format for Color Profiles. 2001.
Lindbloom, Bruce. Chromatic Adaptation. http://brucelindbloom.com/Eqn_ChromAdapt.html
Wikipedia. CIECAM02. https://en.wikipedia.org/wiki/CIECAM02