3
$\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$
  • $\begingroup$ Have you tried other/different pictures? Is the result the same? What's the picture format btw? $\endgroup$ – Paul Gonet Dec 18 '14 at 12:20
  • $\begingroup$ it is a PNG,and I have tried different image and it works. $\endgroup$ – Omar Emara Dec 18 '14 at 12:48
2
$\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

|improve this answer|||||
$\endgroup$
  • 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$ – user7952 Dec 18 '14 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$ – user7952 Dec 18 '14 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$ – user7952 Dec 18 '14 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.