The conversion matrices and some of the transfer functions constants are computed with colour. I did not added a reference as there are no references atm in the codebase.
The way transfer functions are implemented as of now, i.e. in the RGB_to_XYZ and XYZ_to_RGB definitions is not very maintainable which is fine assuming only a few colorspaces are implemented.
The matrices of the various RGB colorspaces don't round trip properly, I would suggest keeping the NPM and have the inverse computed with np.linalg.inv.
I added a round-trip test for the RGB colorspace with transfer functions in mind, could be extended but it is a start.
A few notes:
RGB_to_XYZ
andXYZ_to_RGB
definitions is not very maintainable which is fine assuming only a few colorspaces are implemented.np.linalg.inv
.