the matrix library I was using had an odd 3x3 matrix convention that was bombing the XYZ to sRGB conversion. That was only 3 hours of my life wasted.