PDA

View Full Version : Removing white premultiplication?


StefanAlbertz
06-04-2007, 11:41 AM
How can i remove the white border from an image that is premultiplied on white? After Effects allows to select a color when using premultiplied images, thus removing white border effects on images that were rendererd on white. How can i replicate that using shake?


thanks in advance
stefan

Hugh
06-04-2007, 01:37 PM
Not the nicest of things to work with, but easily fixable...

Create a white solid using a Color node (white colour, but 0 in the alpha)

Create an Outside node. Plug the white colour into the first input, and your image (with alpha) into the second input.

Then create an ISub node - plug your image (on white) into the first input, and the result of the Outside node into the second.

Your result will be your image on black.

If you don't believe me that this will work, here's a faked-up example:

Color1 = Color(500, 500, 1, 1, red, red, 0, 0);
ColorWheel1 = ColorWheel(500, 500, 1, 0, 1, 1, 1);
Blur52 = Blur(ColorWheel1, 90, xPixels/GetDefaultAspect(), 0,
"gauss", xFilter, "rgba");
Over10 = Over(Blur52, Color1, 1, 0, 0);
Outside19 = Outside(Color1, Over10, 1);
ISub5 = ISub(Over10, Outside19, 1, 100);


In this, the result of the Over is effectively what you've got to begin with.

StefanAlbertz
06-04-2007, 04:22 PM
Thank you, Hugh!! Solved my problem :)

beaker
06-06-2007, 02:08 AM
also there is an aepremult macro on highend3d that fixes any AE images that are premultipled by anything other then black. Though it probably does the same thing that Hugh's script does.

CGTalk Moderation
06-06-2007, 02:08 AM
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.