mask/isolate a single greyscale value from a texture with multiple values

Hi,

at the moment I am creating a parent material where I later want to be able to change the colors of different parts of the UVs. So for each part I want to be able to change, I need a mask.

First I created each mask in photoshop and imported them seperately into my material, but now I wanted to try a different attempt, and import all of them as just one texture with different greyscales, and then extract the masks from each greyscale value.
This way I want to save texture samples.
I thought this might become handy later, especially if I want to create a material that needs even more masks then my current one.

So here is what I came up with:

But I’m assuming the 3PointLevels node is pretty heavy and not that smart to use so often. Also it’s not that easy to adjust the levels correctly, so that I achieve the result I want. And it just looks messy.

So does anyone know a better, simpler way, how I could isolate the parts of the texture I want? So that I achieve the same results I did in the screenshot, with the same input texture?

Can you do something with the flipbook node? Just an idea?..

you can just use the if node to return 0 or 1 if the input value equals another value.
you can adjust the equal threshold by clicking on the node. Also could multiply the ‘input a’ by 10 and the then round ‘input b’ if you want to use whole numbers.

the boxmask would work as well.

thank you!
I posted the same question also on reddit, someone already recommended the if node there, but I didn’t manage to pick the exact same values for the middle tiles, so for me it only worked with the black and white tile.
I spend like half a day trying to figure out how I could pick the right value.
knowing that I can set the threshold was the missing link. And it’s so simple it’s almost depressing :smiley:
Thanks again, now it finally works.