Thanks, Sam. I'm aware of Blurred Edges Restoration. We've got a similar macro in house that does pretty much the same thing, but without the typos.
The edge detect is just a Filter set to Sobel. I usually put in an Erode/Dilate and a Blur right after to adjust the qualities of the edge mask. Here's the macro that wraps all of that in a handy single package. Just feed it the composite and the foreground alpha:
- Code: Select all
{
Tools = ordered() {
EdgeBlur = MacroOperator {
CtrlWZoom = false,
NameSet = true,
Inputs = ordered() {
Comments = Input { Value = "Muse Tools Library\r\nby Bryan Ray\r\nwww.musevfx.com", },
Blur = Input { Value = 7.3, },
EdgeWidth = Input { Value = 0.00675, },
EdgePosition = Input { Value = 0.00068, },
Input = InstanceInput {
SourceOp = "edgeBlurInput",
Source = "Input",
},
Matte = InstanceInput {
SourceOp = "MatteIn",
Source = "Image",
Name = "Matte In",
}
},
Outputs = {
Output = InstanceOutput {
SourceOp = "Blend",
Source = "Output",
}
},
ViewInfo = GroupInfo { Pos = { 550, 214.5 } },
Tools = ordered() {
EdgeLoc = ErodeDilate {
CtrlWShown = false,
NameSet = true,
Inputs = {
XAmount = Input {
Value = 0.00068,
Expression = "EdgeBlur.EdgePosition",
},
Input = Input {
SourceOp = "MatteIn",
Source = "Mask",
},
},
ViewInfo = OperatorInfo { Pos = { -220, 142.15 } },
},
edgeBlurInput = BrightnessContrast {
CtrlWShown = false,
NameSet = true,
Inputs = {
Red = Input { Value = 0, },
Green = Input { Value = 0, },
Blue = Input { Value = 0, },
},
ViewInfo = OperatorInfo { Pos = { 110, 10.15 } },
},
Blend = Dissolve {
Transitions = {
[0] = "DFTDissolve"
},
CtrlWShown = false,
NameSet = true,
Inputs = {
Mix = Input { Expression = "EdgeBlur.Blend", },
Background = Input {
SourceOp = "edgeBlurInput",
Source = "Output",
},
Foreground = Input {
SourceOp = "Switch",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 330, 76.15 } },
},
MatteIn = BitmapMask {
CtrlWShown = false,
NameSet = true,
Inputs = {
MaskWidth = Input { Value = 1920, },
MaskHeight = Input { Value = 1080, },
PixelAspect = Input { Value = { 1, 1 }, },
ClippingMode = Input { Value = FuID { "None" }, },
},
ViewInfo = OperatorInfo { Pos = { -330, 142.15 } },
},
edgeDetect = Filter {
CtrlWShown = false,
NameSet = true,
Inputs = {
FilterType = Input { Value = 3, },
Input = Input {
SourceOp = "EdgeLoc",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { -110, 142.15 } },
},
DilateMask = ErodeDilate {
CtrlWShown = false,
NameSet = true,
Inputs = {
XAmount = Input {
Value = 0.00675,
Expression = "EdgeBlur.EdgeWidth",
},
ClippingMode = Input { Value = FuID { "None" }, },
Input = Input {
SourceOp = "edgeDetect",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 0, 142.15 } },
},
BlurComp = Blur {
CtrlWShown = false,
NameSet = true,
Inputs = {
XBlurSize = Input {
Value = 7.3,
Expression = "EdgeBlur.Blur",
},
ClippingMode = Input { Value = FuID { "None" }, },
Input = Input {
SourceOp = "edgeBlurInput",
Source = "Output",
},
EffectMask = Input {
SourceOp = "BlurMask",
Source = "Output",
}
},
ViewInfo = OperatorInfo { Pos = { 110, 76.15 } },
},
BlurMask = Blur {
CtrlWShown = false,
NameSet = true,
Inputs = {
XBlurSize = Input {
Value = 0,
Expression = "EdgeBlur.EdgeMaskBlur",
},
ClippingMode = Input { Value = FuID { "None" }, },
Input = Input {
SourceOp = "DilateMask",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 110, 142.15 } },
},
Switch = Dissolve {
Transitions = {
[0] = "DFTDissolve"
},
CtrlWShown = false,
NameSet = true,
Inputs = {
Mix = Input {
Value = 0,
Expression = "EdgeBlur.MaskView",
},
Background = Input {
SourceOp = "BlurComp",
Source = "Output",
},
Foreground = Input {
SourceOp = "BlurMask",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 220, 76.15 } },
}
},
UserControls = ordered() {
Blur = {
INP_MaxAllowed = 10000,
INP_Integer = false,
INPID_InputControl = "SliderControl",
INP_MaxScale = 100,
INP_Default = 0,
INP_MinScale = 0,
INP_MinAllowed = 0,
LINKID_DataType = "Number",
ICS_ControlPage = "Controls",
LINKS_Name = "Blur"
},
EdgeWidth = {
INP_MaxAllowed = 10,
INP_Integer = false,
INPID_InputControl = "SliderControl",
INP_MaxScale = 0.01,
INP_Default = 0,
INP_MinScale = -0.01,
INP_MinAllowed = -10,
LINKID_DataType = "Number",
ICS_ControlPage = "Controls",
LINKS_Name = "Edge Mask Erode/Dilate"
},
EdgePosition = {
INP_MaxAllowed = 1,
INPID_InputControl = "SliderControl",
INP_MaxScale = 0.01,
INP_Default = 0,
INP_MinScale = -0.01,
INP_MinAllowed = -1,
LINKID_DataType = "Number",
ICS_ControlPage = "Controls",
LINKS_Name = "Edge Position"
},
EdgeMaskBlur = {
INP_MaxAllowed = 10000,
INP_Integer = false,
INPID_InputControl = "SliderControl",
INP_MaxScale = 100,
INP_Default = 0,
INP_MinScale = 0,
INP_MinAllowed = 0,
LINKID_DataType = "Number",
ICS_ControlPage = "Controls",
LINKS_Name = "Edge Mask Blur"
},
Blend = {
INP_MaxAllowed = 10,
INP_Integer = false,
INPID_InputControl = "SliderControl",
INP_MaxScale = 1,
INP_Default = 1,
INP_MinScale = 0,
INP_MinAllowed = 0,
LINKID_DataType = "Number",
ICS_ControlPage = "Controls",
LINKS_Name = "Blend"
},
MaskView = {
INP_MaxAllowed = 1,
INP_Integer = true,
INPID_InputControl = "CheckboxControl",
INP_MaxScale = 1,
INP_Default = 0,
INP_MinScale = 0,
INP_MinAllowed = 0,
LINKID_DataType = "Number",
ICS_ControlPage = "Controls",
CBC_TriState = false,
LINKS_Name = "Mask View"
}
}
}
}
}
My Lightwrap is pretty basic. Invert the alpha and soften it, then multiply by the original alpha—that's what the two Bitmaps are doing. The result is an edge matte with falloff only to the inside. The Lightwrap Merge node has Alpha Gain turned all the way down, making it an Add. The Luma Keyer isolates the bright parts of the background—only the highlights create lightwrap. There should also be a Blur right after the LumaKeyer—you don't want any detail coming through there.
Usually the Lightwrap Merge node has its Blend turned down to almost nothing.