Ok, in the following figure:

On the left is the standard observer color matching functions (CMF), based on primaries XYZ. On the right is a CMF (A B C) that was derived as a linear transformation of XYZ, using the transformation matrix indicated. I've kept this simple - in reality such a CMF would be useless.

I've shown what happens when you "feed" a particular spectral distribution (based on Illuminant E) into the XYZ CMF. What I've done is basically integrate the spectral distribution into the three curves, yielding three values: X, Y, and Z. I then normalized the values (x = X/X+Y+Z, y = Y/X+Y+Z) and have shown the results. They match what they should be. So the code is doing what it's supposed to. Technically I haven't integrated, but rather approximated an integration by summing over 5nm increments, as that was the resolution of my data set. What I believe I've done here is create a simulation, or model, of what actually happens when a tristim device encounters a particular spectral distribution.

I've shown what happens when you feed that same spectral distribution into the ABC CMF. Note the values a and b.

Here I have fed the spectral distribution into the XYZ CMF, but before summing over wavelength, I've transformed each discrete value (at 5nm intervals) using the same transformation matrix that was used to convert XYZ into ABC. I end up with the exact same values for a and b.

Now in the real world, we would want to do the

Either way, what I've shown is that if you have any two color spaces, and you have a model of how one space maps onto the other, then you can derive the output of one space, based only on input to the other space.

In the real world, I suspect this would rarely be possible. In the example I've shown here, I've artificially created the ABC CMF

**Top Row**On the left is the standard observer color matching functions (CMF), based on primaries XYZ. On the right is a CMF (A B C) that was derived as a linear transformation of XYZ, using the transformation matrix indicated. I've kept this simple - in reality such a CMF would be useless.

**Second Row**I've shown what happens when you "feed" a particular spectral distribution (based on Illuminant E) into the XYZ CMF. What I've done is basically integrate the spectral distribution into the three curves, yielding three values: X, Y, and Z. I then normalized the values (x = X/X+Y+Z, y = Y/X+Y+Z) and have shown the results. They match what they should be. So the code is doing what it's supposed to. Technically I haven't integrated, but rather approximated an integration by summing over 5nm increments, as that was the resolution of my data set. What I believe I've done here is create a simulation, or model, of what actually happens when a tristim device encounters a particular spectral distribution.

**Third Row**I've shown what happens when you feed that same spectral distribution into the ABC CMF. Note the values a and b.

**Fourth Row**Here I have fed the spectral distribution into the XYZ CMF, but before summing over wavelength, I've transformed each discrete value (at 5nm intervals) using the same transformation matrix that was used to convert XYZ into ABC. I end up with the exact same values for a and b.

Now in the real world, we would want to do the

*opposite*of what I've done here. That is, we would want to feed a spectral distribution into an arbitrary CMF ABC, and have it output x and y. I could have done that here, but my matrix algebra sucks, and I for now I didn't want to waste time figuring out how to figure out the inverse transformation matrix.Either way, what I've shown is that if you have any two color spaces, and you have a model of how one space maps onto the other, then you can derive the output of one space, based only on input to the other space.

In the real world, I suspect this would rarely be possible. In the example I've shown here, I've artificially created the ABC CMF

*as a linear combination of XYZ*. In reality, these other CMFs we're dealing with (such as the defective, imperfect CMFs of actual colorimeters) are not derived as a linear combination of XYZ. Their CMFs are based on the physical properties of the filters used, and there is*no guarantee*that there is even a solution to the linear transformation between the colorimeter's CMF and the XYZ CMF.