Nuke Yxy Primaries to XYZ

Something that comes up a lot in Colour work is using 3x3 matricies to convert from one RGB colourspace to another RGB space, or more commonly to XYZ space.

Typically these matricies come from a technical document, or from a tool like Nuke's Colorspace node. But sometimes, for whatever reason, you need to convert from some new arbitray space, and working out what that matrix should be is a bit of a pain.

Luckly, Ryan Juckett put up some excellent documentation on how to do it. Previously I'd just filed it under "black art practiced by dudes who use MatLab". By Ryan's walk through was nice and clear.

So, I've bolted together a little Nuke node with a callback to automatically take a set of RGB & W Yxy primaries and create a 3x3 matrix to convert from an RGB image with those primaries and whitepoint to XYZ. Or from XYZ back to an RGB image.

PrimariesToXYZ Properties

I may add a graphical mode at some point, but for now just manually punch the values in.


Just copy grab the script below, and let me know if you find it useful (or if you run into any bugs). PrimariesToXYZ_v001.nk