Page 1 of 1

Predivide and premultiply in DaVinci?

PostPosted: Thu Mar 11, 2021 10:07 am
by Richard.S
I'm new to DaVinci Resolve, so sorry for my beginner question, but I can't seem to find an answer to it online or in the manual.
I'm curious how Davinci works under the hood. If you do a green screen key in Fusion and then do the grade in the Color tab. Does Davinci predivide and then premult with the alpha automatically when applying the grade to avoid black edges? Thanks!

Re: Predivide and premultiply in DaVinci?

PostPosted: Thu Mar 11, 2021 11:19 am
by Hendrik Proosa
VERY unlikely.

Re: Predivide and premultiply in DaVinci?

PostPosted: Fri Mar 12, 2021 8:53 am
by Richard.S
Why is that? Then it's impossible to do a good key in Fusion and grade the footage in the Color tab

Re: Predivide and premultiply in DaVinci?

PostPosted: Fri Mar 12, 2021 9:19 am
by Hendrik Proosa
There are reasons for not doing it automatically: it can mess with your image data (you lose emissive aspects) and you should have control over when and where the unpremult-premult happens. It should be a setting to enable it, so maybe make a feature request?

Re: Predivide and premultiply in DaVinci?

PostPosted: Fri Mar 12, 2021 11:58 am
by Kenzo
Richard.S wrote:Why is that? Then it's impossible to do a good key in Fusion and grade the footage in the Color tab
I usually add an extra MediaOut in Fusion with the key element and use it as a mask in Color for grading.

Re: Predivide and premultiply in DaVinci?

PostPosted: Fri Mar 12, 2021 2:31 pm
by Richard.S
Kenzo wrote:
Richard.S wrote:Why is that? Then it's impossible to do a good key in Fusion and grade the footage in the Color tab
I usually add an extra MediaOut in Fusion with the key element and use it as a mask in Color for grading.


Thanks for the reply! But will that actually solve it? Then you are still grading on a premult image. Do you get rid of black edges when doing that?

Re: Predivide and premultiply in DaVinci?

PostPosted: Fri Mar 12, 2021 2:34 pm
by Richard.S
Hendrik Proosa wrote:There are reasons for not doing it automatically: it can mess with your image data (you lose emissive aspects) and you should have control over when and where the unpremult-premult happens. It should be a setting to enable it, so maybe make a feature request?


I totally agree, it could be just a node in the Color tab. I'm just now delivering a project where I noticed the black edges, so I was hoping there was a workaround. Or that it was just me doing a bad key ☺️

Re: Predivide and premultiply in DaVinci?

PostPosted: Fri Mar 12, 2021 2:56 pm
by Kenzo
Richard.S wrote:Thanks for the reply! But will that actually solve it? Then you are still grading on a premult image. Do you get rid of black edges when doing that?


No because I grade composition.
Quick example.

Image

Image

Re: Predivide and premultiply in DaVinci?

PostPosted: Fri Mar 12, 2021 3:18 pm
by wfolta
Richard.S wrote:
Kenzo wrote:
Richard.S wrote:Why is that? Then it's impossible to do a good key in Fusion and grade the footage in the Color tab
I usually add an extra MediaOut in Fusion with the key element and use it as a mask in Color for grading.


Thanks for the reply! But will that actually solve it? Then you are still grading on a premult image. Do you get rid of black edges when doing that?

Just to make sure, you're talking about grading the FG element separately from the BG, right? (As opposed to grading the final composite.) Which makes sense: to make the FG fit better with the BG. Am I on the right track?

There are a bunch of potential ways to organize things, but I'm thinking that you have the FG clip sitting above the BG clip in your Edit timeline, so your Fusion comp is keying the FG and Edit is compositing it over the BG. In that case, I think you can:

1. In Fusion create an extra MediaOut and wire your MediaIn directly to it, passing on the original image.

2. In Color add a second source and work with that to do your color correction. You can then pull the alpha out of the first source's blue port.

(This is different from Kenzo's solution which passes the composite into Color and the alpha. It passes in the original and the alpha.)

This means that you're only getting your matte from Fusion, so you'd need to do everything else -- like despilling -- in Color. When you apply the matte in Color, it's nice enough to include the BG clip from the timeline in the viewer so you can see the composite.

There are color grading nodes in Fusion. A not-pleasant experience for me, but that's the most straightforward way to color correct in Fusion and to potentially composite in Fusion as well. (And of course, folks who use Fusion Studio -- or Nuke or some other compositor -- have done it that way forever.)

Re: Predivide and premultiply in DaVinci?

PostPosted: Fri Mar 12, 2021 4:11 pm
by smunaut
This might also be interesting to you : viewtopic.php?f=21&t=133928&p=723854

Re: Predivide and premultiply in DaVinci?

PostPosted: Fri Mar 12, 2021 5:20 pm
by Richard.S
wfolta wrote:Just to make sure, you're talking about grading the FG element separately from the BG, right? (As opposed to grading the final composite.) Which makes sense: to make the FG fit better with the BG. Am I on the right track?

There are a bunch of potential ways to organize things, but I'm thinking that you have the FG clip sitting above the BG clip in your Edit timeline, so your Fusion comp is keying the FG and Edit is compositing it over the BG. In that case, I think you can:

1. In Fusion create an extra MediaOut and wire your MediaIn directly to it, passing on the original image.

2. In Color add a second source and work with that to do your color correction. You can then pull the alpha out of the first source's blue port.

(This is different from Kenzo's solution which passes the composite into Color and the alpha. It passes in the original and the alpha.)

This means that you're only getting your matte from Fusion, so you'd need to do everything else -- like despilling -- in Color. When you apply the matte in Color, it's nice enough to include the BG clip from the timeline in the viewer so you can see the composite.

There are color grading nodes in Fusion. A not-pleasant experience for me, but that's the most straightforward way to color correct in Fusion and to potentially composite in Fusion as well. (And of course, folks who use Fusion Studio -- or Nuke or some other compositor -- have done it that way forever.)


Thanks for your long answer Wayne, that is correct, I have the FG over the BG in the edit tab. I found that is the best workflow for my current project.

I'm pretty new in DaVinci so I can't really see how I get the Alpha from Fusion tab to the Color tab. I got the extra media out in Fusion, but I can't see how I can access that alpha in the Color tab?

Re: Predivide and premultiply in DaVinci?

PostPosted: Fri Mar 12, 2021 5:24 pm
by Kenzo
Richard.S wrote:I'm pretty new in DaVinci so I can't really see how I get the Alpha from Fusion tab to the Color tab. I got the extra media out in Fusion, but I can't see how I can access that alpha in the Color tab?


Right click in node view and choose Add Source.

Re: Predivide and premultiply in DaVinci?

PostPosted: Mon Mar 15, 2021 9:19 am
by Richard.S
Kenzo wrote:
Richard.S wrote:I'm pretty new in DaVinci so I can't really see how I get the Alpha from Fusion tab to the Color tab. I got the extra media out in Fusion, but I can't see how I can access that alpha in the Color tab?


Right click in node view and choose Add Source.


I can see that working in the "Clip" section but not in "Group Post-Clip"

I'm really thankful for all the help, but it dosen't seem to be a straight forward way of doing this. Would a feature request with having nodes similar to Fusion with "AlphaDivide" and "AlphaMultiply" be an option? Or maybe I just need to think differently next time I start a project how I set it up

Re: Predivide and premultiply in DaVinci?

PostPosted: Mon Mar 15, 2021 1:11 pm
by Hendrik Proosa
If only DCTLs got access to alpha channel, it would be straightforward to add. For reasons unknown DCTLs only get RGB channels in and out.

Currently it seems you could do it by sending alpha out separately and doing it through blend modes (with all the drawbacks this has including bugs) or through an OFX plugin (which I'm not aware of being available at the moment).