Alpha over compositor artifacts

Hi, I`m trying to create a little scene using flat images (png with alpha transparency) - I’ve got a castle in a bacground and trees in a foreground. I have them on different layers as i need the bacground to be blurred and animate it to get it into focus. I am using alpha over node to put them back together.

Here are two viewport shots - everything looks fine, alpha masks on trees are sharp and clean:



But in compositor everything is messed up, the alpha channel doesn`t work properly, and i got result like this:


I was able to reduce the artifacts by turning on premultiply and using image alpha as factor, but the edges are still jaggy and there are lots of other transparency artifacts.

Any advice how to get rid of those and get a nice rsult as in the viewport? Thanks

What kind of source are you using? Perhaps try another file type for the 2D trees, if PNG try TIFF? looks like something odd happening around the edges where white background occurs.

This is probably something you need to fix in an image editing program like Gimp or Photoshop. My best guess is that your alpha channel isn’t 100% correct, play with the levels in your alpha channel to identify/spot the problem and then brush/paint it away.

shrink or choke matte?

Thanks for the replies. I am using PNGs, i’ll try to switch to targa or tiff. I was examining the alpha channel and it seems ok.

If that doesn’t work you could try eroding and then dilating your alpha channel to remove noise, and maybe give it a small 1 or 2 pixel Gaussian blur?

Ok, so changing image format to tiff with alpha fixed the issue, thanks again for the hint, but i’ve ran into another alpha over problem- In another scene I’ve got one layer of static image background and second layer with 3D object casting shadows on “shadow only” ground plane so it produces nice layer of rendered object with transparent shadow. However, when i combine these two together, the shadows, as they are transparent, disappear. I’ve tried changing the shadow opacity, turned premultiply on and off, nothing changed. When i save each layer as png or tga and combine them manually in PS, everything works fine, so my guess is i am just missing something basic about the alpha over node and i’m feeling kinda stupid.