Jump to: Board index » General » Fusion

Color corrector and Corner pin odd results

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

d3zd3z

  • Posts: 47
  • Joined: Wed Jan 24, 2018 6:45 pm
  • Real Name: David Brown

Color corrector and Corner pin odd results

PostMon Jul 30, 2018 3:49 pm

I'm experiencing some weird behavior when I put a color corrector node before the input to a planar tracker used for corner pin. You can see the result attached. I don't understand why the color corrector is affecting the image outside of the shape from the corner pin.

(This is in Resolve 15b7, but I was able to reproduce the results in Fusion 9, hence the post here).

I'm not real sure what to do about this, since this behavior doesn't match what I thought the corner pin was supposed to do.

Thanks,
David

Media1 is the scene with the dog and the tiles. MediaIn2 is a square image of just the tile.

nodes.png
Nodes in question
nodes.png (64.29 KiB) Viewed 1936 times

end-result.png
End appearance
end-result.png (760.12 KiB) Viewed 1936 times
MacOS/Linux, Divinci Resolve 16, Fusion 16.
Offline

JP Docherty

  • Posts: 188
  • Joined: Wed Dec 31, 2014 2:37 pm

Re: Color corrector and Corner pin odd results

PostTue Jul 31, 2018 7:28 am

At a guess it looks like a pre-multiplication issue caused by the colour corrector adding to the black areas around the cornerpin area. I'd try putting an AlphaMultiply node (found in the Matte submenu) between the colour corrector and the merge.

If that works I'd suggest you check out how pre-multiplication works - this fun video from ConFusion is a good start.



and a more technical breakdown is here:

http://www.spherevfx.com/written-traini ... ed-images/
Offline

JP Docherty

  • Posts: 188
  • Joined: Wed Dec 31, 2014 2:37 pm

Re: Color corrector and Corner pin odd results

PostTue Jul 31, 2018 7:30 am

Sorry I see you are using the planar tracker as a merge - I'd still try adding the AlphaDivide node between the colour corrector and the planar tracker.
Offline
User avatar

Bryan Ray

  • Posts: 2491
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: Color corrector and Corner pin odd results

PostTue Jul 31, 2018 3:09 pm

You don't want to just AlphaMultiply because that will often cause a dark fringe (generally speaking, but probably not in this case because there wouldn't be any antialiasing going on prior to the transformation.) The image needs to be unpremultiplied before the CC, then premultiplied again after. For your convenience, there is a switch in the color corrector called pre-divide/post-multiply that will do it without needing additional nodes.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

JP Docherty

  • Posts: 188
  • Joined: Wed Dec 31, 2014 2:37 pm

Re: Color corrector and Corner pin odd results

PostTue Jul 31, 2018 5:44 pm

Bryan is quite right - I should have said that if adding the divide node leaves just a fringe then you know it's a premultiplication issue and need to deal with that, perhaps after learning more from the sources I mentioned.

I'd also add that Bryan's own excellent work in progress primer for Fusion -

http://www.bryanray.name/wordpress/comp ... -contents/

will undoubtedly address this when complete, if it doesn't already.
Offline

JP Docherty

  • Posts: 188
  • Joined: Wed Dec 31, 2014 2:37 pm

Re: Color corrector and Corner pin odd results

PostTue Jul 31, 2018 5:47 pm

. . . and finally, I've had odd situations where the pre-multiply switch in the colour corrector didn't seem to work.

As using the external divide and multiply nodes gave me more control anyway and as this was the way we used to do it in Shake (one of the early compositing apps, now sadly gone) I got into the habit of doing it this way rather than actually tracking down what was happening with the CC node.
Offline

d3zd3z

  • Posts: 47
  • Joined: Wed Jan 24, 2018 6:45 pm
  • Real Name: David Brown

Re: Color corrector and Corner pin odd results

PostWed Aug 01, 2018 4:36 am

I guess it suggests that I don't really understand what the corner pin is doing. I intuited that it would perform a transformation on the input image (to the corner pin area), and apply it with a mask selecting that area. I'm surprised to see a rectangular area outside of that, which suggests it is instead doing this possibly in multiple steps.

Maybe I should try to create what the corner pin is doing using the Planar tracker and whatever other nodes would end up having the same effect. But, I'm not quite sure what that would be.

Thanks,
David
MacOS/Linux, Divinci Resolve 16, Fusion 16.
Offline

JP Docherty

  • Posts: 188
  • Joined: Wed Dec 31, 2014 2:37 pm

Re: Color corrector and Corner pin odd results

PostWed Aug 01, 2018 6:25 am

Did you try adding the AlphaDivide node as suggested?

The cornerpin node does what you say it does and creates a matte. It's extremely likely that your problem is the colour corrector node - you have created a correction that at some point uses one of the additive functions as oppossed to multiplier functions like gain or gamma. This means that the black areas in the cornerpined image are no longer black and the premultiplication built into the cornerpin image is no longer correct. This is normal and fairly common.

Another way to test this would be to send another image with a matte into the colour corrector node and see if the same thing happens.
Offline
User avatar

Bryan Ray

  • Posts: 2491
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: Color corrector and Corner pin odd results

PostWed Aug 01, 2018 5:40 pm

Remove the Corner Pin from your thinking. That's not where the problem is. The problem is that your Color Correct has changed the black point of the Foreground image. Examine these nodes for an illustration:


Code: Select all
{
   Tools = ordered() {
      ColorCorrector1_2 = ColorCorrector {
         CtrlWZoom = false,
         Inputs = {
            MasterRGBBrightness = Input { Value = 0.06, },
            ColorRanges = Input {
               Value = ColorCurves {
                  Curves = {
                     {
                        Points = {
                           { 0, 1 },
                           { 0.4, 0.2 },
                           { 0.6, 0 },
                           { 1, 0 }
                        }
                     },
                     {
                        Points = {
                           { 0, 0 },
                           { 0.4, 0 },
                           { 0.6, 0.2 },
                           { 1, 1 }
                        }
                     }
                  }
               },
            },
            HistogramIgnoreTransparent = Input { Value = 1, },
            Input = Input {
               SourceOp = "Transform1",
               Source = "Output",
            },
            EffectMask = Input {
               SourceOp = "Transform1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 825, 148.5 } },
      },
      Transform1 = Transform {
         Inputs = {
            Size = Input { Value = 0.496, },
            Input = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 214.5 } },
      },
      ColorCorrector1 = ColorCorrector {
         Inputs = {
            MasterRGBBrightness = Input { Value = 0.06, },
            ColorRanges = Input {
               Value = ColorCurves {
                  Curves = {
                     {
                        Points = {
                           { 0, 1 },
                           { 0.4, 0.2 },
                           { 0.6, 0 },
                           { 1, 0 }
                        }
                     },
                     {
                        Points = {
                           { 0, 0 },
                           { 0.4, 0 },
                           { 0.6, 0.2 },
                           { 1, 1 }
                        }
                     }
                  }
               },
            },
            HistogramIgnoreTransparent = Input { Value = 1, },
            Input = Input {
               SourceOp = "Transform1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 825, 214.5 } },
      },
      Background1 = Background {
         Inputs = {
            GlobalIn = Input { Value = 1, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 0.331, },
         },
         ViewInfo = OperatorInfo { Pos = { 440, 214.5 } },
      },
      AlphaDivide1 = AlphaDivide {
         Inputs = {
            Input = Input {
               SourceOp = "Transform1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 715, 280.5 } },
      },
      ColorCorrector1_1 = ColorCorrector {
         Inputs = {
            MasterRGBBrightness = Input { Value = 0.06, },
            ColorRanges = Input {
               Value = ColorCurves {
                  Curves = {
                     {
                        Points = {
                           { 0, 1 },
                           { 0.4, 0.2 },
                           { 0.6, 0 },
                           { 1, 0 }
                        }
                     },
                     {
                        Points = {
                           { 0, 0 },
                           { 0.4, 0 },
                           { 0.6, 0.2 },
                           { 1, 1 }
                        }
                     }
                  }
               },
            },
            HistogramIgnoreTransparent = Input { Value = 1, },
            Input = Input {
               SourceOp = "AlphaDivide1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 825, 280.5 } },
      },
      AlphaMultiply1 = AlphaMultiply {
         Inputs = {
            Input = Input {
               SourceOp = "ColorCorrector1_1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 935, 280.5 } },
      }
   }
}



In the lower branch is the bracketed AlphaDivide/Multiply procedure JP describes. The upper branch is an alternative (but not recommended) approach, where the CC is masked with the alpha of the image. It's not recommended because it can create issues in antialiased edges, which might result in fringing.

The center shows the issue you're experiencing, where the CC is changing black, 0-alpha pixels to something other than black, but still 0 alpha.

This is not a failure or limitation of the software—it's a foundational concept of compositing.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

d3zd3z

  • Posts: 47
  • Joined: Wed Jan 24, 2018 6:45 pm
  • Real Name: David Brown

Re: Color corrector and Corner pin odd results

PostFri Aug 03, 2018 9:40 pm

These explanations are helpful, but I still don't quite understand how this is happening. My input image to the color corrector has an alpha that is entirely white. It is just a big rectangle. I don't believe the color corrector is changing this.

The corner pin seems to do two things: 1. It does a transform on the input image to match the pinned area. 2. It creates a mask in that shape so the image only affects the desired area. The alpha involved here is coming from the corner-pin, right? It appears to be applying this to the smallest rectangle that will fit around the transformed image, and somehow it is deciding upon a black value other than 0 (because of what the color corrector did to the input image).

I ended up making a mask, with a soft border, smaller than the full pinned area, which does keep the changes from appearing outside of the desired area.

But, I think I'll ask another question to see if others have advice on how to best do this composite anyway.

Thanks
MacOS/Linux, Divinci Resolve 16, Fusion 16.

Return to Fusion

Who is online

Users browsing this forum: No registered users and 21 guests