How to get opacity from the white color? (Materials)

I have a white image with a transparent background.

I want the white part to have a percentage of opacity (Variable Opacity).
I’m interpolating between black and white and multiplying by the resulting gray.

However the image becomes darker instead of transparent.

I guess maybe I need to separate the black pixels from the white ones or something like that…

Does anyone know the correct way to do this?

This is my material:

Thank you so much!!

1 Like

If opacity isn’t in A, try one of RGB. Something might be close…

Hi @ClockworkOcean

The image is fine… I just want to give it a transparency percentage on the opaque part… (I thought that by painting some pixels black I could achieve that) Is this possible?

if you have a black background then increasing transparency will make opaque part evidently darker as you said. you goal is not quite clear. if you have an img with 0 opacity background and > 0 opacity parts, then just multiply opacity by whatever variance you need.

I’m sorry… the material is working… I should have tested it well before opening the thread…

I also get the same effect using this node.

Captura de pantalla 2024-10-11 112746

Moderators may delete this post if they deem it necessary.

Thank you so much @ClockworkOcean

1 Like

Thank you for your comment…
My mistake… the problem never existed.
I’m ashamed now.

It might be hard to tell how much ammo you have? What about fading left to right? :smiley:

1 Like

It can always be improved… I will try your idea too…

1

Thank you so much @ClockworkOcean

1 Like