4
$\begingroup$

I am making a node group, and I want to remove the alpha from an image. I added a set alpha node and set the factor to 1, but this gives me a crazy result as you see in the screenshot. I 'm using a normal image with black text and an alpha background, but when I add the set alpha node, the image goes crazy. enter image description here

I also tried using an alpha over node, but that didn't work either.

$\endgroup$
2
  • $\begingroup$ Have you tried other/different pictures? Is the result the same? What's the picture format btw? $\endgroup$ Commented Dec 18, 2014 at 12:20
  • $\begingroup$ it is a PNG,and I have tried different image and it works. $\endgroup$ Commented Dec 18, 2014 at 12:48

1 Answer 1

3
$\begingroup$

Sometimes in PNGs that have alpha channel the image get interpreted in a weird way as RGB only (without the alpha). Here's an example of how blender interprets such image:

enter image description here

Maybe someone else can explain why... I find that the program in which PNGs are generated can make a difference.

But as a quick solution in this particular case, try connecting the alpha of your Image node to the alpha of the Set Alpha node.

enter image description here

$\endgroup$
3
  • 2
    $\begingroup$ You would probably have to read the source code to be certain as to why this happens. The first thing that comes to mind though, is the fact that PNG images actually contain colour data for transparent pixels, and that colour data is masked out by the alpha channel. $\endgroup$ Commented Dec 18, 2014 at 13:58
  • 2
    $\begingroup$ If all transparent pixels have the exact same colour, and the alpha channel contains only the values 0 (fully transparent) and 1 (fully opaque), the transparent pixel may be converted to a unique colour (only needed if there are also opaque pixels of that colour), then marking that colour as transparent, similarly to how transparency is done in GIF. My guess is that some software does this by default, while others default to using a separate alpha channel even in these cases. $\endgroup$ Commented Dec 18, 2014 at 14:39
  • 2
    $\begingroup$ PNG also supports indexed colours, and then an alpha channel is not supported at all, and transparency must be encoded within the used palette. $\endgroup$ Commented Dec 18, 2014 at 14:45

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.