How can you edit the Separate and Combine Colour Nodes to include LCH Colour Space?

I have already asked this before here on this site and Reddit, but I’m determined to find a solution to my problem. So here’s the basic gist:

I am beginning work on a project that involves colourising a clip from an old black and white Doctor Who episode. I want to make it look as realistic as possible. Unfortunately, however, the best way I can go about it usually is utilising an LCH (lLuminance, Chroma, Hue) colour space which can guarantee the best possible results. I have tried using the main colour spaces within the Separate and Combine Colour nodes like HSV and YUV, but they can be a challenge to deal with when trying to get good skin tones (which is a high priority for me). With that said, since Blender is a customisable software, is it possible to re-edit the code of the Separate and Combine Colour nodes to include the LCH Colour Space? Can you please show me how to do it?

I think you need to convert sRGB to XYZ first, then from there to CIE, and then to LCH.
It’s a bit of work as the ShaderNodes don’t have matrices multiplications, but it’s doable.
You might want to look into the math for all of these convertions here.

You can then build two nodegroups, one for sRGB to LCH and the other for the inverse operation.

Not without doing it in the source code.
But you can replace your Combine/Separate Color nodes with custom ones made in python.

1 Like

It does sound like a lot of work. I’m not sure how to go about editing the source code, but I might try and install a new version of Blender to try and see what I can do. I know little to nothing about coding, but as long as I have help with that, I’d be grateful.

If you can build the functions from the website I referenced with nodes, then you’re half way there.
If you preferer to have the sRGB ↔ LCH as a separate node, then you can use the nodegroups as they are.

Creating a new Combine/SeparateColor node with python is also not very difficult… in particular if you have the nodegroups already. And I might also help you with that.

2 Likes

I would greatly appreciate your help, please.