How to Handle the RGB / CMY Six Color Mask in the Blender Shader Editor?

I tried to use a mask image of six colors red, green, blue, cyan, magenta, and yellow in shader editor using a combination of separate RGB, separate HSV, and mixRGB nodes with difference blending mode.

The results I got looked somewhat good, but they weren’t perfect compared to masking method, which uses pure R, G, B three colors and uses only separate RGB node.

Is there the best way to handle one image of R, G, B, C, M, Y? Or if you have any tutorials or documents related to pixel math to achieve this, please recommend them.

The GIF below shows my attempts to separate R channels from image mixed with C, M, Y, and the contraction that appears on the outer edges of the color when using the luminance filtering method. A pure Separtate RGB node has no such shrinkage and is flawless.

rgbcmy mask
rgbcmy mask compare

1 Like



7way Lerp?

3 Likes

original colors


changed colors

It’s amazing!!
I personally followed the node tree and connected the viewer nodes one by one from input to output, but I didn’t realize what was going on. Maybe it’s time for me to need pixel math for understanding.
But could you give me a simple explanation for a beginner like me?

On the other hand, the color variations from the RGB maintain a smooth outline. However, i found that color variations from CMYW tend to leave 1 pixel thickness of traces around it. This seems to be the limit of images with colors mixed by anti-aliasing.

Basically its binary coding. Each color channel is treated as bit. So RGB will be 3 bits - 000


Black is all 0
Red is just red at 1
Yellow is Red and Green at 1 and blue 0.

Yea, interpolation its limitation of this. But it fits if You dont use blending or use it smartly

4 Likes

Hi, I’m back with additional questions.
While I was investigating matte, I found it was a clown pass.
I’ve seen them have so many colors.
Does the clown pass cause problems with anti-aliasing and interpolation when a color other than RGB is adjacent?
If there’s no problem, how is it possible?

clown pass 01

clown pass 02

clown pass 03