You guys might find this article interesting.
It presents a linear algebra problem, then writes a program to solve it in Maple, Mathematica, and Maxima to see which one is better. What do you think?
Here is an example of manipulating an Array of pixels. I chose the xrite ColorChecker as a model so there would be published results to check my work. A number of details about color spaces have become clear through this exercise. The color adaptation process was modeled by converting betweenXYZ and LMS. Different black points may be selected depending on how close to zero illuminance one would accept as a good model.
I look forward to extending this work to verify and improve the color calibration of my photography. Also some experimentation with demosaicing should be possible.
xrite Colorchecker xyY Matrix
=
=
=
=

Convert XYZ to Lab (D50 or D65 White Point)



=

Convert XYZ to aRGB (XYZ D50 or D65 to aRGB D65)


XYZ Scaling for aRGB Ymax,Ymin (Ref. Adobe RGB (1998) Color Image Encoding Section 4.3.2.2 and 4.3.8)
White Point (Luminance=160Cd/m^2) D65

Black Point (Luminance=0.5557Cd/m^2) D65

White Point (Luminance=160Cd/m^2) D50

Black Point (Luminance=0.5557Cd/m^2) D50

=
=
=

=
=
=





(ref. Adobe RGB(1998) section 4.3.6.1, Bradford Matrix includes D50 to D65 adaptation)
(ref. Adobe RBG(1998) section 4.3.4.1, Bradford Matrix assumes XYZ is D65)
aRGB Expansion for 8bits
Combine Steps

Note: The aRGB values published for ColorChecker assume a black point of 0cd/m^2.
=
=
=
Note: The sRGB values published for ColorChecker assume a black point of 0cd/m^2.
=
=

Download Pixel_Conversion.mw