The EdgeDetect node in Nuke is good, but limited. Perimeter is a more advanced option for making custom edge mattes.
➔ Fast. Perimeter has been streamlined to be efficient and lightweight.
➔ Powerful. Customise and fine tune your edge matte to get it exactly right.
➔ Accurate. Under the hood, Perimeter is using Erode_Fine by SpinVFX for sub-pixel accuracy.
➔ Global controls for quickly setting up the edge matte:
Select the Source channel to use for creating the edge matte. By default, it is the alpha channel of the Source input.
(Optional) Select the Mask channel to use for the mask. By default, it is the alpha channel of the Mask input, if connected.
Expand the edge matte both inward and outward at the same time.
Apply a Round filter to round out the edges of the matte.
Soften the edge matte both inward and outward.
Offset the edge matte inward or outward. (💡 Works as intended when both the Enable Inner and Enable Outer checkboxes are ticked).
Control the output bounding box. A side will output the edge matte’s bounding box. B side will output the Source input’s bounding box. Union will output the union of A and B. Or, Crop the bounding box to the Source input's format (i.e. not its bounding box).
Add Source interaction. Mask or stencil the edge matte by the Source.
➔ Individual controls for fine tuning the inner and outer edges:
Expand the edge matte inward or outward individually.
Enable/disable the inner or outer edge individually.
Soften the inner or outer edge individually.
Limit the softening to the inside or outside individually, or let it spill over from one to the other.
Mix back the opacity of the inner or outer edge individually.
Example: Using Perimeter to make a custom edge matte with a softer inside than outside edge.
I hope you find Perimeter useful. For more Nuke tools, see Nuke.