Method to use for chromatic adaptation. Bradford by default.
Working space for both the input and the eventual output. sRGB by default.
RBG image in floating point form.
XYZ illuminant under which input was recorded.
XYZ illuminant that input should be chromatically adapted to.
Chromatically adapted floating point RGB image.
Chromatically adapt RGB input from the given source illuminant to the given destination illuminant.
We employ the von Kries coefficient law for chromatic adaptation. A cone response under a source illuminant is converted to one under a destination illuminant via diagonal scaling of the cone response components. The output of the chromatic adaptation between a pair of illuminants can be tweaked by chromatic adaption methods which define the conversion to and from XYZ to cone responses (LMS).
References: http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
https://en.wikipedia.org/wiki/Von_Kries_coefficient_law#Chromatic_adaptation
https://en.wikipedia.org/wiki/CIE_1931_color_space#Color_matching_functions
https://en.wikipedia.org/wiki/LMS_color_space
http://scottburns.us/chromatic-adaptation-transform-by-reflectance-reconstruction/