Previous topicNext topic

ADDing colours with blend module, alpha channel troubles

Questions, comments, feedback, etc.
Post Reply
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

ADDing colours with blend module, alpha channel troubles

Post by blackdot »

so i have this base picture of colorful things on a sphere. the top half of the image is transparent (it has an alpha channel). beneath this picture is the pic of the flower. works nicely:
2016-06-24_1734.png
2016-06-24_1734.png (957.11 KiB) Viewed 4015 times
now i want to ADD some other pic to the sphere-pic which doesnt have an alpha channel. as far as I understand all this, this should work perfectly while still preserving the transparency of the first pic.

this is the pic i want to ADD:
2016-06-24_1734_001.png
2016-06-24_1734_001.png (804.01 KiB) Viewed 4015 times
however it seems to work generally, but not completely:
2016-06-24_1735.jpg
2016-06-24_1735.jpg (279.47 KiB) Viewed 4015 times
for some reason the background flower is darkened just a bit. any idea why? i verified that the pic i want to add, is completely black at that place and the pic with the alpha channel is completely transparent there (as you also can see in the first screenshot).

module setup is like this:

Code: Select all

sphere.png_____
                |
                blend(add)_________
pic-to-add______|                 |_
                                   _Magic
flower-backgroundpic______________|
thaanks
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: ADDing colours with blend module, alpha channel troubles

Post by Magic »

I'm not sure, but I think you'd probably want to do a little "hack" like this:

Code: Select all

pic_to_add_________________
                           |
Sphere __                  |
         |                 Blend________Magic
         Translate(0,0,0)__|
Flower __|
The Translate module acts as a "junction" box which just combines two inputs into one (since the sphere has a proper alpha channel). Then you blend the final image on top of that.

If that doesn't work maybe you can post the images and I'll see what I can do :).
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

Re: ADDing colours with blend module, alpha channel troubles

Post by blackdot »

heh, yes that does work. :D awesome. no idea why it is though. thanks for the quick answer. *flies away productively*

does the blend module somehow mess with the alpha channel? my original problem was gone when i my "pic-to-add" also had a meaningful alpha channel.
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: ADDing colours with blend module, alpha channel troubles

Post by Magic »

The Blend module is designed for images that *don't* have an alpha channel. It's really for color blending only. So an alpha channel can actually screw things up.

I should probably add that to the documentation :)
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

Re: ADDing colours with blend module, alpha channel troubles

Post by blackdot »

Eric wrote:The Blend module is designed for images that *don't* have an alpha channel. It's really for color blending only. So an alpha channel can actually screw things up.

I should probably add that to the documentation :)
could it be rewritten so that it passes any incoming alpha channel though then? or that it also does the math on the incoming alpha channels and puts out RGBA again? :geek:
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: ADDing colours with blend module, alpha channel troubles

Post by Magic »

Possibly, if I can do it in a way that won't affect anyone's existing projects.
Post Reply