Alpha Over Node

http://www.cafes.net/ladyb/meshmanglers/elephantcolor3.jpg
Hi
I used the alpha over node to put the elephant and ground on top of a sky background. Why did I get this outline around the elephant and ground? And how do I keep this from happening please.

try the premultiply-button in the node… maybe that’s it…

Thanks, simhar. I did a quick little test render and it was fixed.

Attachments


I’ve also been playing with nodes and discovered this same thing. However there are two interesting observations:

1: in the default alpha node, on my screen, the button only shows “convert” I only discovered just now that if I make the node wider it says “convert premul”

2: My test blend has four render layers. I alpha “one over two” and “three over four” then direct both alpha results into a third “Alpha Over” node to get the final composite. Interestingly, I pressed the premul button on the first Alphas for the desired result as mentioned by oldskoolPunk but if I press it on the final Alpha node (where the two alpha results are combined), the result is unattractive with dark edges on sections of the alpha edge.

Thats weird. Can you not get the desired results at all? I haven’t tried anything that complex yet, I still have to try to understand render layers. But I’m wondering why the option is even there. Why would anyone want those weird lines around thier forground objects?

Wow. After all my whining about the search feature in this forum, I searched for Render Layers and actually found topics that answered my question. First time for everything I guess :slight_smile:

Yes, I should have mentioned that leaving the button “off” in the final Alpha node produced the desired effect (or so it appears).

My setup wasn’t really complex, I just wanted to do a simple fake depth of field so I broke my model/scene up into separate layers (most of it was modelled that way anyway) and worked the rest out through guesswork from there. Now I have a vague understanding of render layers (remember to include the lights and camera layer in every render layer!) I’ll be more careful about how I split my scenes up in future.

As for the “convert premul” option, I can only assume it’s because Alpha has more uses than just this sort of compositing. But I’ve got a whole lot to learn about this stuff yet.

to clarify premultiplied-alpha’s:

An alpha channel has a value of between 0 and 1. When you make an image transparent (to composite it over another one), you are really multiplying the RGB pixel values by the alpha values (making the image transparent (0) where the alpha is black (0), and opaque (1) where it is white (1)).

So, to composite image A over image B, you get the alpha of image A and multiply it by image A, thus making the image part of A opaque and the rest transparent. You then inverse the alphs of A and multiply image B by it, thus making image B transparent where A is opaque and vice versa. You then add the resultant images and get the final composite.

This is all done in the composite node in most compositors automatically.

A pre-multiplied alpha is when the image (RGB) pixels are already multiplied by the alpha channel, therefore the above compositing op doesn’t work too well, and you have to hit ‘convert pre-mult’. This is only an isuue in semi transparent area, and egdes usually.

It also depend on whether or not you have rendered your image as a pre-mult, or straight RGBA image.

To try it: render an image with a pre-mult alpha, and save it as a jpeg, and the as a .png: The colour will be slight different in the problem area. Also, render the same iomage with a straight alpha and save as a jpeg and compare the two jpegs, again the problem areas will seem different.

Hope this helps,
DT

Thank you for your post, deep thought. I added it to the wiki today. In fact, it inspired me to write the whole darn section!!!