Changing colours precisely, procedurally I assumed this had been asked before but can't find anything that does what I need.
I have an image texture (a png) which uses 18 different colours. I want to be able to use the shader editor to change each individual colour and then apply that to a surface. So e.g. where the original texture has a particular yellow, make the surface orange; where the texture has blue make the surface green, etc.
Connecting the texture's colour to the fac input of a colour ramp may be the best/only approach, but:
a) it's not clear from Blender's manual how an RGB image is mapped to just one value (fac) when you connect nodes - but it seems from googling it's using luminance. (Is that right?)
b) if that is the case, it seems a bit clunky as I believe that different RGBs can have the same luminance
Separating the RGBs also doesn't seem to work, as then you are dealing with each channel separately. I would like to be able to say e.g. 'take colour (25, 50, 100) and change it to colour (100,150,0) - i.e. my desired output depends on all three of the RGB channels in combination, not individually.
If anyone has any advice on this, I would appreciate it.
Many thanks
John
Yes, FAC is driven by luminance (from 0.0 to 1.0), and yes, two different colors can have the same luminance.
The task isn't impossible, but you would end up with a very complicated node tree, which will have to recognise each of the 18 colors and send them to 18 color nodes or a color ramp.
I think it would be simpler to use an image editor software to create a copy of the texture with 18 different shades of grey, and use this new texture to drive a color ramp.