PDA

View Full Version : premultiplied alpha


mahmoudcg
06-04-2007, 07:13 PM
hi everyone
i'm rendering 3d images to be composited and corrected in after effects and I want to know if I shall use premultiplid alphas or not
right now when I use premultiplied alpha I get white parts in semitransparent pixels. so why is it happening? when I choose to use straight alpha it is gone. here are the images

original
http://xs116.xs.to/xs116/07231/aster01_resize.jpg (http://xs.to)

premultiplied alpha
http://xs116.xs.to/xs116/07231/aster02_resize.jpg (http://xs.to)

straightunmatted alpha
http://xs116.xs.to/xs116/07231/aster05Comp1_resize.jpg (http://xs.to)

also when I choose to use premultiplied alpha in after effects there is a color swatch set to black as default... what does this color mean, when I play with it I get deifferent edge results

jeremybirn
06-05-2007, 04:15 AM
When you render with pre-multiplied alpha, be sure that your background color is black.

-jeremy

mahmoudcg
06-05-2007, 04:20 AM
yes I see, thanks for the reply, so whats the benefit of working with premultiplied alphas?

mahmoudcg
06-06-2007, 02:27 AM
c'mon guys I'm confused about this, when to use premultiplied alphas and when to not
can someone give me a hand on this

jeremybirn
06-06-2007, 02:56 AM
I was almost tempted to quote a few pages from chapter 11 of my book, but to be brief: Pre-multiplied alphas are the default for 3D graphics. They give you a fully anti-aliased image, they give you the ability to use whatever compositing operations you want such as adding layers together without using alphas for a clean composite, and they give you perfect alignment between image and alpha so that operations like blurring the elements work as cleanly as possible at the edge pixels.

Sometimes people avoid pre-mult if they are compositing in Photoshop or After Effects, where there are sometimes some problems with edge pixels. Sometimes they avoid them for ambient occlusion passes (when they aren't full-screen) because those are only going to be used by multiplication with other layers. An if you are making sprites for a video game where you don't want the sprite edges anti-aliased against the background, I guess that's another time you could play with turning premult off.

Really, you ought to be able to deal with elements correctly either way, you just might choose different ways to composite them in a given program.

-jeremy

mahmoudcg
06-06-2007, 05:50 PM
thanks a lot Jeremy for your time and explanation, I got it and will definitely read more about this

CGTalk Moderation
06-06-2007, 05:50 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.