Premultiplied color

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  02 February 2010
Premultiplied color

How can I change the premultiplied color of some premultiplied rendered footage. In combustion this is very easy to do. I just cant find it in nuke. I need to change it from black to white.

Thanks
 
  02 February 2010
make friends with the tab key......will bring up a hotbox where you can type Premult or unpremult

Unfortunately though, Nuke assumes the color of the alpha channel for the premult. ie: black for 0, and white is 1. You will have to setup your own network if you want a different color.
__________________
: my website :
 
  02 February 2010
the actual solution (other than the workaround posted) is also in this linked thread...one really shouldn't use any other background-color than black to premultiply against when rendering


c.
 
  02 February 2010
(fg * a) + (bg * (1-a) = Comp.

This is the most important equation to know in compositing. It's the equation for a standard "Over" composite. If you know it and understand it you'll be able to solve many a problem. In plain english it's:

(Premultiplied Foreground) + (Background * Inverted Alpha) = Composite.

In this case you've already composited your fg over your bg (white). So you have:

(fg * a) + (1 * (1-a)) = comp.

What you want is just the (fg*a) part so what you do is simply subtract the other term:

(fg * a) + (1 * (1-a)) - (1 * (1-a)) = (fg * a)

That still can look a little intimidating so written out more simply you can see it as:

A + B = C

but we just want A so we subtract "B" and get:

A + B - B = A

In this case "B" = the inverted alpha. In short. Invert the alpha and subtract it from the fg.

Class Dismissed! Go make some art!

P.S. Christopher's solution though is the best.

Last edited by thatoneguy : 02 February 2010 at 08:08 AM.
 
  03 March 2010
Wow thanks for the info. I dont see a link for ChristopherP?
 
  03 March 2010
i was talking about the linked vfxtalk-thread scrawford posted...sorry for the confusion
 
  03 March 2010
Cool thanks for clarifying. So I understand the overall concept described in the thread, but I don't get how the following translates into anything in nuke.

set cut_paste_input [stack 0]
version 5.1200
push $cut_paste_input
Dot {
name Dot1
selected true
xpos 345
ypos -141
}
set N28375e50 [stack 0]
Dot {
name Dot2
selected true
xpos 479
ypos -141
}
push $N28375e50
push $N28375e50
Invert {
channels rgba
name Invert1
selected true
xpos 227
ypos -145
}
Constant {
inputs 0
channels rgb
color {1 0 0 0}
name BG_COLOR
selected true
xpos 168
ypos -238
}
Copy {
inputs 2
from0 rgba.alpha
to0 rgba.alpha
name Copy1
selected true
xpos 168
ypos -108
}
Premult {
name Premult2
selected true
xpos 168
ypos -69
}
Merge2 {
inputs 2
operation minus
name Merge1
selected true
xpos 311
ypos -69
}
Dot {
name Dot3
selected true
xpos 345
ypos -6
}
Copy {
inputs 2
from0 rgba.alpha
to0 rgba.alpha
name Copy2
selected true
xpos 445
ypos -16
}
Dot {
name Dot4
selected true
xpos 479
ypos 57
}


Is this a script I need to input somewhere?
 
  03 March 2010
That's how Nuke comps are stored. Just copy all that (don't miss any brackets) and paste it into your Nuke DAG.
 
  03 March 2010
you can literally just copy&paste that segment into nuke. or save it as a .nk file somewhere and import it back into nuke via file->import script.

edit: doh, replied a little too late


c.

Last edited by ChristopherP : 03 March 2010 at 08:49 PM.
 
  03 March 2010
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:33 AM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.