Change color of texture based on alpha

Hi, I’m trying to change the white color of an image to black, whilst where alpha equals 0 to be transparent:

I can change the white part to any color (which is red in the image below), except black, when I use a vector of 0,0,0,1 the texture stays completely transparent.

Appreciate your help, thanks.

Did you try OneMinus node?

Plug a different color in Lerp A input, you’ll understand how it works

first, you dont have opacity enabled in the material so theres no way that it could be transparent.
Second, the way that lerp node works is it uses 0 for the A bind and 1 for the B pin, any value in between 0 and one will be a blend between a and b.

if youre using a black and white texture, Black = 0, and White = 1. So anything Black will be the A pin of the lerp, and anything White will be the B pin of the lerp, and grey will be a blend between A and B.

if the texture youre plugging into the alpha pin is completely black, It will only use whatever is plugged into the A pin (right now thats nothing so it will be black.

so now from what I have gathered from your question, you want everything white from the texture to be Black, and you want everything Black from the texture to be transparent?

if so, you can achieve this by finding the BLEND MODE dropdown in the Details panel on the right, and setting it to Transparent. plug nothing into the base color, plug the red pin from your texture into the Opacity pin. thats it.

1 Like