Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
AUTODESK COMBUSTION:Autodesk Combustion ForumAutodesk Combustion TutorialsAutodesk CombustionAutodesk

unpremultiply in combustion?

COW Forums : Autodesk Combustion

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook
Mayec Runpremultiply in combustion?
by on Jan 29, 2007 at 6:50:49 pm

I'm having a problem. I'm compositing CGI elements which were rendered with premultiplied alpha and do NOT include the alpha. Alpha is in a separate file sequence. Thus, I use the alpha pass for compositing through the "Set Matte" Operator... and I get the expected ugly dark fringe.

I can find no way to solve this problem. Is there a way to unpremultiply in combustion? Even the most manual aproach seems impossible, since I can't find a way to mathematically divide the pixel's RGB values by the Alpha value.


Return to posts index
Reply   Like  

Rayk HemmerlingRe: unpremultiply in combustion?
by on Jan 29, 2007 at 11:42:10 pm

ehh? premultiplication means that you have an embedded alpha; the alpha is in the rgb values. what is the file format of the cg footage? if you saved the cg image which has no alpha then it's not premultiplied, it's just rendered against a bg color (i guess black). some thoughts here:
sometimes c* don't get that there's actually an alpha channel and you have to set it mannually in the footage controles. that's, if there's an alpha channel in the file, after all. you might try a luma key or use shrink and erode after you set the matte.
rerender from your 3d app? i think one of the sapphire plug-ins have a divide op.

best,
-rayk


Return to posts index
Reply   Like  

Mayec RRe: unpremultiply in combustion?
by on Jan 29, 2007 at 11:56:01 pm

Thanks for your reply Rayk.

The file does not have alpha embedded, but, believe me, it is premultiplied. Premultiplied is the same as what you mean by "rendered against a bg color". If saved as premultiplied, the pixels that do not have a full (white) alpha value are partly mixed with the black background, and thus are darkened, resulting in the ugly dark fringe we all know, when they are *again* multiplied by the alpha in the compositing process (in the "set matte" step in this case).

If it were not premultiplied, the render would look very ugly, with strange white-ish aliased borders, but it would composite perfectly with a separate alpha pass and I would have no problems

Check in your 3D application: save TGAs with premultiplied alpha and without (both without embedded alpha) and see the difference.

Rerendering would be the best option right now, but it's not an option anymore (big slow Vray renders, tight deadline). I'll look at the sapphire plug-ins you mention...

Mayec


Return to posts index
Reply   Like  


gary m. davisRe: unpremultiply in combustion?
by on Jan 30, 2007 at 3:39:03 am

you cant premultiply if you dont save the alpha

//gD

gary m. davis // visualz.com
application training specialist
3ds Max | Combustion | Toxik
"don't key DV!"


Return to posts index
Reply   Like  

Mayec RRe: unpremultiply in combustion?
by on Jan 30, 2007 at 8:11:23 am

I don't agree. As I said before, an image can be premultiplied without having saved the alpha that was used in the multiplication. As I said to Rayk, try to save a render from your 3d software both as TGA 24 bits premultiplied and not premultiplied, and see the difference.


Return to posts index
Reply   Like  

JusRe: unpremultiply in combustion?
by on Jan 30, 2007 at 1:09:24 pm

I am of the belief that the multiplication or pre-multiplication of bitmap data is a math sum that only exists to define the transparencies of pixels - ie - the alpha.

I am not sure how that sum is relevant in an image with no transparency defined...

...if you multiply an rgb colour by 1 (fully opaque) you get the same answer.

I've got two words to say... Steve and Wright...;-)

Hope this helps...

Justin Edible


Return to posts index
Reply   Like  


Rayk HemmerlingRe: unpremultiply in combustion?
by on Jan 30, 2007 at 3:06:40 pm

maybe to get the steam out of the discussion before it gets really hot.
of course, the transparency of your fg object was taken into account by your 3d program to produce the rendered image. it would have done so, too, when there's something behind your transparent fg object. it's simply the way objects at different distances to each other get "packed" together to render the final image, that's the rgb info in it. you might relate it to an "over node"/operation in a compositing program. if i have a fg layer and a bg layer and i want to combine them together, it's done in the following manner: (fg*alpha)+(bg*(1-alpha)) in plain words, you take the rgb date of your fg layer and multiply them with the fg alpha values. you take the bg rgb values and multiply them by the inverse fg alpha values. then, you add both. that's just one small step of how a 3d renderer comes up with a picture, which i'm far from being expert in. since you usually have a lot of layers to comp in your composite it was handy to incorporate the first step of this "over operation" in the image file. the image was "pre"-multiplied, that is for further compositiong. in your case, the cg fg object with it's transparency/alpha information was composited/layed over a solid bg. when you choose to save that file "pre-multiplied" with a separate alpha file your 3d app gave you the above result as rgb info in a tga file and a separated file which contains the alpha. but that's not what is generally referred to as "pre-multiplied". the term itself refers to a way how transparency information can be stored in an image file. the alternative is "non-premultiplied" or "straight". in any case, the terms refer to alpha information in the image file.
now, you have a final rgb image and the alpha info which was used to derive that result, as well as, you know the bg color. it is fair to say, that you can reverse engineer that over operation which was done by your 3d app. unfortunately, c* doesn't have a divide node or operation (in the rgb arithmetics, for instance). but as i mentioned in my first reply, there might be options.

in case i wrote something which was not correct,please correct me.

cheers,
rayk


Return to posts index
Reply   Like  

Eric CraftRe: unpremultiply in combustion?
by on Jan 30, 2007 at 4:01:40 pm

You can find a more detailed explaination of what rayk described the go to the webpage here. The website also provides various other alpha related info/tutorials here.

-Eric


Return to posts index
Reply   Like  

Mayec RRe: unpremultiply in combustion?
by on Jan 30, 2007 at 7:17:21 pm

Thanks Rayk!

That was a very extense, precise and clear exposition of the problem. Now we know we're talking about the same thing. Thanks for not letting the conversation bog down!
So, on with it: I'm looking for ways to reverse engineer that step that happened during render, as you skillfully put it, and after fiddling with everything I could think of in Combustion, I'm looking for plug-in related solutions. There's an AfterFX plugins pack called Walker Effects, which includes unpremultiply (or divide) operations, but sadly it doesn't work with Combustion. So now I'm going to try the demo of the Sapphire plug-ins you told me about earlier. Updates coming soon...



Return to posts index
Reply   Like  


Mayec RRe: unpremultiply in combustion?
by on Jan 30, 2007 at 7:46:45 pm

Rayk, very honestly: THANK YOU!

The Sapphire division plugin did the trick. At last, a solution! Really, I'm eternally grateful for your help, not just because you solved my problem, but even more because you put quite some interest into shedding some light over my question. Anytime you need something I can do for you, let me know.

Mayec


Return to posts index
Reply   Like  

Rayk HemmerlingRe: unpremultiply in combustion?
by on Jan 31, 2007 at 1:11:31 am

well, thank you for your offer :o)
i thought about it a bit longer ... would you do a short test?
take your fg footage and just put it in the workspace.
do the same with the alpha and bg footage.
apply an arithmetic rgb op to the bg. apply a matte controle op to the fg alpha and check inverse. use this as a secondary input to the arithmetic op of the bg; connect all to r,g,b . in the arithmetic op set all three channels operator to multiply and channel to alpha. -your bg should display now a black hole in the shape of the fg alpha-. in the bg branch use another arithmetic rgb op (on top of the already present) and pipe the fg footage into the secondary input connectiong all three channels. set operator to add and in the channels red to red, green to green ... .
does it give you the same result as you get with the sapphire plug in?
it's a bit too early here in germany to test it myself :o)

glad i was of any help.
cheers,
rayk


Return to posts index
Reply   Like  

Mayec RRe: unpremultiply in combustion?
by on Jan 31, 2007 at 12:41:12 pm

Rayk, I just yout new idea, and you are absolutely right. It does work perfectly! It's a very nice and elegant solution. You gave me not one, but two solutions to the problem, one with plug-in and one without! You're my hero! ;)

Seriously, I've asked about this issue to many people and in a couple of suposedly "expert-level" forums and mailing-lists, and you're the only one who's nailed it! Thanks again. As I said, anytime I can help you with anything, do ask and I'll do my best.

cheers,
Mayec


Return to posts index
Reply   Like  


Jeff BrownRe: unpremultiply in combustion?
by on Feb 1, 2007 at 3:44:20 pm

I'm saving the math too! Thanks, Rayk. It makes sense: multiply is the inverse of division, after all, but thanks for thinking it through. Very cool.

-jeff


Return to posts index
Reply   Like  

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook


FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2013 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]