Inverse of a texture for masking?

Hey, I was wondering how you can get the inverse of a texture?
Like in photoshop when you have a grayscale image you can make the white values black and the black values white. I need this because I’m generating a texture during runtime with my kinect and want the inverse of this image for masking.

I’ve got the mask working, but it’s masking everything that is black and I need it the other way arround.

so I thought the easiest way was the inverse of my texture. If you have other better solutions I’m all ears aswell :smiley:

Just read the Texture2D docs: SetPixels and Apply can hand-edit however you want. All you need to know is that colors are stored 0-1 (which is pretty standard.) So can easily loop through and set each channel to 1-channel. Should be able to find lots of examples of pixel changing. Takes a bit to run, though.

But, depending on how the Mask works, should be possible to change it to Mask out white instead.