Page 1 of 1

Trouble combining two magic mask nodes

PostPosted: Sun May 05, 2024 8:24 pm
by NeilMyers
I have an image (building roof from drone footage) I need to composite. I want the still image to show up ONLY on the roof, but then I also need to mask out a tower that is between the drone and roof (and moves its position continuously).

NOTE: I use PlanarTracker to keep the still image in precisely the right place throughout the footage. But then I need to mask it in two ways:

1) I used a MagicMask first to mask out the tower. In this case I invert the mask. That works reasonably well.

2) I then used a second MagicMask on top of that (prior to that?) to create the mask of the roof. Here I want the masked area to be transparent, and the rest opaque, so I don't do an inverse.

It works, but everything outside the roof mask is darkened quite a bit. Here is a screen cap showing the drone footage before (left) and after compositing (right):

https://www.dropbox.com/scl/fi/wktbj8rwlxx94f85rit8v/Screenshot-2024-05-05-131244.png?rlkey=9jhkiftr3ohyiu48b2ycoxlm1&dl=0

Here is my node structure.

https://www.dropbox.com/scl/fi/ahz0zxmresi6i664n8efd/Screenshot-2024-05-05-131126.png?rlkey=fd4ojkp53hciho47oo4z19ip6&dl=0

What am I doing wrong?

THANKS!

Re: Trouble combining two magic mask nodes

PostPosted: Sun May 05, 2024 9:21 pm
by KrunoSmithy
NeilMyers wrote:I have an image (building roof from drone footage) I need to composite. I want the still image to show up ONLY on the roof, but then I also need to mask out a tower that is between the drone and roof (and moves its position continuously).

NOTE: I use PlanarTracker to keep the still image in precisely the right place throughout the footage. But then I need to mask it in two ways:

1) I used a MagicMask first to mask out the tower. In this case I invert the mask. That works reasonably well.

2) I then used a second MagicMask on top of that (prior to that?) to create the mask of the roof. Here I want the masked area to be transparent, and the rest opaque, so I don't do an inverse.

It works, but everything outside the roof mask is darkened quite a bit. Here is a screen cap showing the drone footage before (left) and after compositing (right):

What am I doing wrong?

THANKS!


I imagine darkening comes from the color correction node.

Merge nodes have two inputs, orange for background and green for foreground. They also have a blue input for effect mask. This mask can further be inverted or multiplied from the settings tab in the Merge node.

You have added the magic mask as a green input, meaning foreground. This essentially copies the original Drone footage on top of Bruce image. If you only want to use Magic Mask to mask something and not as a layer of original drone footage, than add the magic mask to the blue instead of green input of the merge node.

If you want to combine more than one mask, weather they are coming from Magic Mask or some other tool. use The Matte Control node

It is used to combine and manipulate the alpha channels embedded in images as well as masks created by masking tools. Typically, you add this node to copy a color channel or alpha channel from the foreground input to the background input, or to combine alpha channels from the two images. There are various operations you can do in that node.

Remember in Fusion orange input in the merge node is for background elements, and green for foreground elements, meaning its a layer on top, while blue input is for masks. Also background will always have primacy in terms of resolution so whatever you put as orange input, background that is, it will determine the dimensions of the merge operation. Whatever you put in the green input, foreground that is, will be added as a layer on top of the merge operation. Merge node itself has blend mode sand other features in case you want to blend it that way. Like blend modes in Photoshop. Merge node also has blue input for masks.

You can also use Merge node for resizing operation, but it is generally recommended to use transform node or something similar after the merge node, to keep the node tree easier to read.

P.S.
If you hold the right mouse button as you connect the nodes it will give you a useful pop up menu with the list of all the inputs you can connect to. Sometimes there are many of them.

Re: Trouble combining two magic mask nodes

PostPosted: Sun May 05, 2024 9:47 pm
by NeilMyers
THANK YOU!

Switching which node I input the MagicMask was the fix.

I can tell I need to really learn these node inputs better!

Re: Trouble combining two magic mask nodes

PostPosted: Sun May 05, 2024 9:55 pm
by KrunoSmithy
NeilMyers wrote:THANK YOU!

Switching which node I input the MagicMask was the fix.

I can tell I need to really learn these node inputs better!


Great.

Yeah, Once you learn how the nodes work and inputs work, its much easier to do the rest.

Re: Trouble combining two magic mask nodes

PostPosted: Sun May 05, 2024 10:42 pm
by NeilMyers
Shoot -- I spoke to fast. It did get rid of the darkness, but only by losing the mask entirely. Here is what I did:

1. I remove the color correction mode. FYI, that was only affecting the Bruce image, so that didn't fix the issue. But I left it off just to be sure.

2. I switched the output from the MagicMask to the blue input on the merge node (i.e., the Effect Mask).

The result is that the Bruce image composites on top of the Drone footage, but with no mask applied. So, the Bruce image "colors outside the lines" (it shows up off the roof).

I'm back to research mode.

Re: Trouble combining two magic mask nodes

PostPosted: Mon May 06, 2024 11:09 am
by KrunoSmithy
NeilMyers wrote:I'm back to research mode.


Here is something to think about. I use this method on difficult to track shots. Like this basketball player with a loose t-shirt swinging about, him jumping about and light shift and change in perspective, rotation and scale. When the subject is easy to track based on color I use 3D Keyer or HSL keyer. When its not, I try Magic Mask to isolate the subject and than track it.

Original video on Pexels by Pavel Danilyuk

https://www.pexels.com/video/man-playin ... l-5192069/


MagicMask-Tracking.Assist.jpg
MagicMask-Tracking.Assist.jpg (997.33 KiB) Viewed 434 times