Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
FORUMS: listlist (w/ descriptions)archivetagssearchhall of famerecent posts

The premultiplication blues...

Cow Forums : Nuke

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
The premultiplication blues...
by David Frisk on May 6, 2009 at 2:27:35 pm

I want to apologize in advance to those of you who may have read a similar post of mine in the shake forums months back. I want to understand this 100%. Since Pete seems to come from a background of both AE and Nuke, I thought maybe his answer (or anyone else's that would like to jump in) could help me out.

It's back to the dreaded talk of premultiplication. In my understanding, if an image/video has an embedded alpha channel in it inside of Nuke, it basically ignores it by default. So the equivalent in After Effects would be as though the interpret footage dialogue box was set to ignore alpha. Is that right?

Now, if you add a premultiply node to the image in Nuke, it will take that alpha into consideration. It will make the portions of the image where the alpha is black, transparent, and portions of the image where the alpha is white, opaque, while the different shades of gray are varying opacities. Right? Now in AE, there are two choices of telling the program you have an alpha - premultiply or straight. Since "premultiply" and "straight" basically are the same, with the exception that the "premultiply" setting gets rid of any color fringing from the semi-transparent parts of the alpha channel picking up parts of the images background, my guess is that Nuke's premultiply node is the equivalent to AE's "straight" setting. Is that correct? Does Nuke have an equivalent to AE's "premultiply" setting that gets rid of any color fringing that may happen? In AE you just pick that setting and tell it what color the fringing is and it gets rid of it. Does Nuke have anything like that?

I guess what really got me confused over the whole premultiply thing in Nuke/Shake was that I never realized that it's set to ignore the alpha by default. Because I don't understand why if you don't add a premultiply node, why can you still see transparent areas as though it's not being ignored by default when you use an Over node? When you don't add a premultiply node, and you use the Over node, it seems as though it still uses the alpha channel even though it should be ignoring it. But it seems to use it in a weird way. If there is alpha black in a spot where the image is also black, it makes it completely transparent (again, even though I thought the alpha should be ignored by default unless adding the premultiply node). If there is alpha black in a spot where the image is dark blue (for example), it's semi-transparent. If there is alpha black in a spot where the image is a pretty bright color, it's even less-transparent. The lighter the color, the less transparent it becomes.

So it seems that in the Over node, even though I'm basically telling it to ignore the alpha channel by not appending a premultiply node, it decides to take the alpha into consideration anyway, and does so in a weird way by also taking the color of the actual image into consideration as well and using that to determine where things should be transparent/opaque. I guess I just don't understand why that is.

Sorry for the long rant and thanks for any help in understanding this. Much appreciated.

Respond to this post   •   Return to posts index

Re: The premultiplication blues...
by Peter O'Connell on May 9, 2009 at 4:21:32 am

Hi David.

[David Frisk] "In my understanding, if an image/video has an embedded alpha channel in it inside of Nuke, it basically ignores it by default."

I dont see this in Nuke. Premultiplied images come in premultiplied and straight images come in straight.

[David Frisk] "Since "premultiply" and "straight" basically are the same, with the exception that the "premultiply" setting gets rid of any color fringing from the semi-transparent parts of the alpha channel picking up parts of the images background"

I don't think they are the same, premultiplied has transparency (alpha) applied and straight doesn't.

[David Frisk] "my guess is that Nuke's premultiply node is the equivalent to AE's "straight" setting. Is that correct?"

Nope. Premultiply does the same thing in Nuke as it does in AE.

[David Frisk] "Does Nuke have an equivalent to AE's "premultiply" setting that gets rid of any color fringing that may happen?"

There should never be any colour fringing if all colour corrections are done to only the rgb channels (straight).


[David Frisk] "if you don't add a premultiply node, why can you still see transparent areas as though it's not being ignored by default when you use an Over node?"

You still get a result when you use over even if it isn't premultiplied however the over math, A+B(1-a), is not working as intended.
The equation is read, "The A image plus the B image times one minus the A images alpha". Remember the premultiplication math considers black to be zero and white to be 1. So to come back to the equation, where A's alpha is white (value of 1) the B image is multiplied by 1 minus 1 which is zero. So you see the A image. Mess around with that equation.

Hope this helps

Pete

roguekeyframe.com


Respond to this post   •   Return to posts index

Re: The premultiplication blues...
by David Frisk on May 12, 2009 at 6:49:48 pm

Thanks for the clarification Pete. After you answered my question, I decided to read some of the compositing books I had over and over and over again to try to explain premultiplication. For some reason, I couldn't get a grasp on it. I understand it in After Effects, but using it in a node based compositor just seemed to trip me up. I also got tripped up on the math as well. I thought that in that equation, not only was B multiplied by the inverse of A's alpha, but that A itself was multiplied by it's own alpha as well (which is why I couldn't understand why it would matter whether the RGB had color where the alpha was black, because I figured it would be multiplied to black anyway). So between you and the books, I managed to finally understand it all.

Anyway, long story short, thanks for the help.

I have one last question though. Let's say I make a soft-edged, red circle in photoshop, and make the alpha match that circle. Instead of black as the background though, I have a white background. When I bring that into Nuke, and I use the premultiply node to drop out the white and make it black before using an over node, the part where there is semi-transparency on the soft-edge of the circle picks up some of the white in the RGB channel that was originally in the background. In AE, you can interpret that footage as premultiplied and then pick the color of the background so that it gets rid of that little white fringe that would appear. How would you accomplish the same in nuke?

Again, thanks for your time!

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]