Page 1 of 2

Mix Texture and images with alpha channel

Posted: Thu May 18, 2023 2:41 pm
by Andreas_Resch
I'm stuck at what seems to be a trivial task. I want to put a transparent image (TIFF with transparency) on top of another texture. I tried using a Mix Texture node and fed the Texture Out socket into the "Second Texture" socket as well as the "Amount" socket. But the result doesn't look correct. The only way I can get it two work is to load the image twice, once into an RGB image node and then again into an Alpha Image node. But that can't be the best way to do it, having to always have to create two nodes for the same image. I've seen some older tutorials on Youtube where they do that. But surely there have been some changes in the meantime. Has anybody got a solution?
Alpha_01.jpg
In Blender I can connect the Alpha socket of the image to the Factor, which makes sense.
Alpha_02.jpg

Re: Mix Texture and images with alpha channel

Posted: Thu May 18, 2023 3:48 pm
by Andreas_Resch
Hmmm. I'm not sure I can follow that. For one you seem to mix materials. I want to mix textures. And then there's a node where the opacity is stored in a red channel (?). I haven't got any opacity stored in any of the color channels. I have a TIFF file with transparency included.

Re: Mix Texture and images with alpha channel

Posted: Thu May 18, 2023 4:42 pm
by Andreas_Resch
Thanks. Could you please expand the mask layer of the circle so i can see the settings that you use in there. I tried Composite Texture but those settings are a bit overwhelming and I was not able to find a proper combination.

Re: Mix Texture and images with alpha channel

Posted: Sat May 20, 2023 8:34 am
by Andreas_Resch
I tried to recreate your node tree, but it doesn't work for me. As you can see my smileys are blended with the noise layer below. The opacity is merely calculated from the RGB info with the transparent parts being interpreted as black. From what I see in your node tree is, that you used an Alpha Image node as input into the mask layer. I need to use an RGB Image as I also want to use the opaque parts of the image.
Alpha_03.jpg

Re: Mix Texture and images with alpha channel

Posted: Sat May 20, 2023 10:52 am
by J.C
If you have an image with alpha channel you need to use separate node for this image – Alpha Image. It's only used for extracting alpha channel. For other images use RGB or Grayscale image nodes.
compossite texture.jpg

Re: Mix Texture and images with alpha channel

Posted: Sat May 20, 2023 11:10 am
by Andreas_Resch
I probably didn't make myself clear enough. I want to overlay a transparent image that contains BOTH RGB information AND has transparency in it as well. For now I (as I don't know it better yet), I always have to create two nodes (RGB Image as well as Alpha Image) for each image that I want to overlay. But that will always result in twice the work, for creating as well as changing the images. In Blender I have two output sockets on the image node - one for the RGB information and one for the Alpha information. And if I want to change that image I only have to reload the image once.

Here's the image I want to overlay ... http://www.argfx.at/upload/smiley.zip

Re: Mix Texture and images with alpha channel

Posted: Sat May 20, 2023 11:45 am
by J.C
As I said in previous reply, RGB or Grayscale image node does not output alpha channel. You need to use Alpha Image node to get alpha channel from an image.
In the end you will have two texture nodes, one for alpha and one for rgb information.

Re: Mix Texture and images with alpha channel

Posted: Sat May 20, 2023 11:57 am
by Andreas_Resch
Sometimes you have to take the bumpy road. Thanks anyway.

Re: Mix Texture and images with alpha channel

Posted: Sat May 20, 2023 12:39 pm
by J.C
Andreas_Resch wrote:Sometimes you have to take the bumpy road. Thanks anyway.
I wish it was easier too.

Re: Mix Texture and images with alpha channel

Posted: Sat May 20, 2023 12:42 pm
by Andreas_Resch
The day will come when one of the devs will realize that there are file formats now that can store transparency as well ;)