Jump to: Board index » General » Fusion

FUSION (in resolve) Unmultiply (and colour page too)

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

Jean Paul Sneider

  • Posts: 265
  • Joined: Sat Jul 01, 2017 5:46 pm

FUSION (in resolve) Unmultiply (and colour page too)

PostThu Sep 10, 2020 2:16 pm

Hi,
I am trying to achieve something and I do not get if I am doing something wrong or if it shouldn't work.

I am trying to set up a better workflow to color correct copositing when I am given matte.

Starting from the assumption that:

COMPOSED SHOT = (ADDED_ELEMENT*a+ PLATE*(1-a))
ADDED_ELEMENT = (COMPOSED_SHOT-(PLATE*(1-a)))/a

So I tried it in the colour page using the layer nodes with no success, I tried moving to Fusion where things might be kept tidier. Using a custom tool where I feed:
IMAGE 1 = PLATE
IMAGE 2 = COMPOSED SHOT
IMAGE 3 = B/W MATTE

I add to the three channels:
(c2-(c1*(1-c3)))/c3

Whatever I get is unusable and if I do the inverted process nothing good comes out of it and doesn't goes back when I try to do the inverse process.
Dividing by 0 I am sure doesn't help but I saw a lot of videos about unmultiplying where dividing by alpha is not a problem.
Online

Sander de Regt

  • Posts: 3586
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: FUSION (in resolve) Unmultiply (and colour page too)

PostThu Sep 10, 2020 2:27 pm

What are you trying to achieve in layman's terms?
Are you trying to seperately color correct an element after it was added to the plate?
In that case you can also just color correct the composed shot while using the B/W matte as an input for a a bitmap mask on the color corrector.

I doubt that using the custom tool will be the most efficient approach, but I am not sure what you're trying to accomplish.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

Jean Paul Sneider

  • Posts: 265
  • Joined: Sat Jul 01, 2017 5:46 pm

Re: FUSION (in resolve) Unmultiply (and colour page too)

PostThu Sep 10, 2020 2:39 pm

That's exactly what I am trying to do, and yes I could simply use the matte as I always did in colour. But I am trying to figure out if there is a better way to do it. When compositing is better to color correct the unmultiplied image, so I am trying to replicate the process.
Offline

Hendrik Proosa

  • Posts: 3055
  • Joined: Wed Aug 22, 2012 6:53 am
  • Location: Estonia

Re: FUSION (in resolve) Unmultiply (and colour page too)

PostThu Sep 10, 2020 2:40 pm

Basically you want to decompose a merged image by knowing the composite, original BG and fg alpha as I understand it. It works and your math looks correct, but in practice there are two limitations:
1) your alpha must be exact, otherwise you get garbage;
2) you will still get some garbage due to rounding errors.

Are you doing your math on linearized values? Are you in float project not int8/int16?

Division by zero is handled without falling flat on face in any comp software worth their weight. But unpremultiplication inevitably creates random and sometimes huge values for areas where alpha value is very small. Rounding errors can compound there and produce huge spikes.
I do stuff
Online

Sander de Regt

  • Posts: 3586
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: FUSION (in resolve) Unmultiply (and colour page too)

PostThu Sep 10, 2020 3:17 pm

Dividing by 0 I am sure doesn't help but I saw a lot of videos about unmultiplying where dividing by alpha is not a problem.

I think that most videos about unmultiplying are about doing that to the seperate elements.
Most color tools in Fusion have a special checkbox for that.
You describe that you only have the end result but not the seperate elements, so you'll need to jump to couple of more hoops to get what you need.

As Hendrik said, depending on the accuracy of your source material, some garbage may occur depending on how the elements are composited together. If the edges and the plate were massaged together to be slightly softer than the original element or if a glow was added over the end result you'll encounter some issues.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

Jean Paul Sneider

  • Posts: 265
  • Joined: Sat Jul 01, 2017 5:46 pm

Re: FUSION (in resolve) Unmultiply (and colour page too)

PostThu Sep 10, 2020 3:46 pm

Ok, mid way going through this post I managed to get it right.

1) I redid the tree I think I had a piping error in the first place in the recomping section.

2) I have to accept that the alpha divided clip looks awful, more than what I am used to.

3) Still new to the process but I have to remmber that often this is the problem: Clips blacks and whites! after the alpha divide and before the color correction.
Offline

Hendrik Proosa

  • Posts: 3055
  • Joined: Wed Aug 22, 2012 6:53 am
  • Location: Estonia

Re: FUSION (in resolve) Unmultiply (and colour page too)

PostThu Sep 10, 2020 4:02 pm

Clipping whites is definitely not normal, you mean values above 1.0 clip? Or you mean you should clip them? It depends on the value range of your images, you could clip erratic values if it improves result after grade. Value 1.0 is arbitrary, it has any significance only in display domain.
You shouldn’t have negative values anyway, at least not in casual situations.
I do stuff
Offline

Jean Paul Sneider

  • Posts: 265
  • Joined: Sat Jul 01, 2017 5:46 pm

Re: FUSION (in resolve) Unmultiply (and colour page too)

PostFri Sep 11, 2020 9:41 am

Clip whites in the post divide, where I divide by 0, and then remultiply. Various sourcs that work with multiply and divide do it as far as I have saw. If you wish I will try to collect those sources, not sure if I am allowed to post youtube link and external links here
Offline
User avatar

TheBloke

  • Posts: 1905
  • Joined: Sat Nov 02, 2019 11:49 pm
  • Location: UK
  • Real Name: Tom Jobbins

Re: FUSION (in resolve) Unmultiply (and colour page too)

PostFri Sep 11, 2020 10:06 am

Jean Paul Sneider wrote:not sure if I am allowed to post youtube link and external links here
Both are fine. YouTube links will automatically embed, just paste the link directly into the forum post, no need to use URL tags. But don't use the "Copy Video URL at Current Time" option on YouTube, as the forum's embedder won't link to that time, and it will break the video's thumbnail.
Resolve Studio 17.4.3 and Fusion Studio 17.4.3 on macOS 11.6.1

Hackintosh:: X299, Intel i9-10980XE, 128GB DDR4, AMD 6900XT 16GB
Monitors: 1 x 3840x2160 & 3 x 1920x1200
Disk: 2TB NVMe + 4TB RAID0 NVMe; NAS: 36TB RAID6
BMD Speed Editor
Offline

Jean Paul Sneider

  • Posts: 265
  • Joined: Sat Jul 01, 2017 5:46 pm

Re: FUSION (in resolve) Unmultiply (and colour page too)

PostFri Sep 11, 2020 10:32 am

first ones that I managed to retrieve:

Should be somthing after minute 8

EDIT:
The playback goes from realtime to 0.5/2.5 fps system hardware barely used. I recreated the effect in the color page it goes realtime with no problem

My nodes are:

Code: Select all
{
   Tools = ordered() {
      Rebuild = Custom {
         CtrlWZoom = false,
         NameSet = true,
         Inputs = {
            LUTIn1 = Input {
               SourceOp = "CustomTool2LUTIn1",
               Source = "Value",
            },
            LUTIn2 = Input {
               SourceOp = "CustomTool2LUTIn2",
               Source = "Value",
            },
            LUTIn3 = Input {
               SourceOp = "CustomTool2LUTIn3",
               Source = "Value",
            },
            LUTIn4 = Input {
               SourceOp = "CustomTool2LUTIn4",
               Source = "Value",
            },
            RedExpression = Input { Value = "c1*(1-c3)+c2*c3", },
            GreenExpression = Input { Value = "c1*(1-c3)+c2*c3", },
            BlueExpression = Input { Value = "c1*(1-c3)+c2*c3", },
            Image2 = Input {
               SourceOp = "ColorCorrector1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 327.334, 172.727 } },
      },
      CustomTool2LUTIn1 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 204, Green = 0, Blue = 0 },
         NameSet = true,
      },
      CustomTool2LUTIn2 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 204, Blue = 0 },
         NameSet = true,
      },
      CustomTool2LUTIn3 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 0, Blue = 204 },
         NameSet = true,
      },
      CustomTool2LUTIn4 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 204, Green = 204, Blue = 204 },
         NameSet = true,
      },
      ColorCorrector1 = ColorCorrector {
         Inputs = {
            WheelTintAngle1 = Input { Value = 0.200200222883313, },
            WheelTintLength1 = Input { Value = 0.2977, },
            MasterRGBContrast = Input { Value = 1.79, },
            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 = "BrightnessContrast1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 496, 119.394 } },
      },
      separation = Custom {
         NameSet = true,
         Inputs = {
            LUTIn1 = Input {
               SourceOp = "CustomTool1LUTIn1",
               Source = "Value",
            },
            LUTIn2 = Input {
               SourceOp = "CustomTool1LUTIn2",
               Source = "Value",
            },
            LUTIn3 = Input {
               SourceOp = "CustomTool1LUTIn3",
               Source = "Value",
            },
            LUTIn4 = Input {
               SourceOp = "CustomTool1LUTIn4",
               Source = "Value",
            },
            RedExpression = Input { Value = "(c2-(c1*(1-c3)))/c3", },
            GreenExpression = Input { Value = "(c2-(c1*(1-c3)))/c3", },
            BlueExpression = Input { Value = "(c2-(c1*(1-c3)))/c3", },
            Comments = Input { Value = "IMAGE 1 = PLATE\nIMAGE 2 = COMPOSED SHOT\nIMAGE 3 = B/W MATTE", },
         },
         ViewInfo = OperatorInfo { Pos = { 276, 93.3334 } },
      },
      CustomTool1LUTIn1 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 204, Green = 0, Blue = 0 },
         NameSet = true,
      },
      CustomTool1LUTIn2 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 204, Blue = 0 },
         NameSet = true,
      },
      CustomTool1LUTIn3 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 0, Blue = 204 },
         NameSet = true,
      },
      CustomTool1LUTIn4 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 204, Green = 204, Blue = 204 },
         NameSet = true,
      },
      BrightnessContrast1 = BrightnessContrast {
         Inputs = {
            ClipBlack = Input { Value = 1, },
            ClipWhite = Input { Value = 1, },
            Input = Input {
               SourceOp = "separation",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 384, 96.9698 } },
      }
   }
}
Offline

Hendrik Proosa

  • Posts: 3055
  • Joined: Wed Aug 22, 2012 6:53 am
  • Location: Estonia

Re: FUSION (in resolve) Unmultiply (and colour page too)

PostFri Sep 11, 2020 11:34 am

In linked clip values are clipped for mask, not for image data. This is to prevent values outside range 0.0-1.0 which don’t make any sense for masks, because mask is a “no effect” to “full effect” range kind of data.
I do stuff
Offline

Jean Paul Sneider

  • Posts: 265
  • Joined: Sat Jul 01, 2017 5:46 pm

Re: FUSION (in resolve) Unmultiply (and colour page too)

PostFri Sep 11, 2020 12:04 pm

Looks I misunderstood the video so, since I got fromit that it was done on the part of the image that is then used for the edges.

So i circle back to my question. Why without clipping it doesn't work, how do I make this work, why it works with my tweak, the images are identical.

The problem comes in the black parts of the alpha, no matter the quality of the exported alpha.

And ideas about the terrible performance?
Offline

febros

  • Posts: 34
  • Joined: Thu Aug 13, 2020 6:50 am
  • Real Name: Aniol Marin

Re: FUSION (in resolve) Unmultiply (and colour page too)

PostWed Sep 16, 2020 10:40 am

this "terrible performance" seems like another instance of my own nightmare with Fusion right now.

Have you checked your VRAM usage when you run the preview cache? If it ramps up and triggers the shared memory it's probably this same scenario.
Resolve 17.1 (or newer), Fusion 9
Windows 10 / Debian 10.8
Ryzen 3900X, GTX 1080Ti, 64Gb RAM @ 3200MHz
Audio: Echo FireWire 12 + Presonus Octopre MkII

Return to Fusion

Who is online

Users browsing this forum: No registered users and 77 guests