- Posts: 456
- Joined: Thu Sep 16, 2021 7:05 am
- Real Name: Cody Predum
I'd say there are three general 'features' of a Merge node:
- Transforming a foreground
- Adjusting opacity of that foreground
- Compositing that foreground over a background (blend modes)
With regard to blend modes, I don't think the question makes sense. Blend modes are mathematical calculations for creating a new image from the pixels of two input images. Therefore by definition the output is a composite of both images. Removing the background from a Merge would just give you the original foreground, and vice versa.
So the only place I can see this making sense is with regard to the Merge's transform controls, and Blend slider.
To get a "FG only" output of those, you could do this:

First you do your transformation in a Transform node, and the result of that can then be piped out separately if desired. Therefore no transformation would be done in MergeComposite at the end.
Then, for the Blend (opacity) slider, we do that in a separate Merge which is over an Alpha=0 background. MergeOpacity only has the Blend slider operated, and because it's merging over a transparent background, the result is that we just change the FG opacity without compositing it over anything that would change the FG image in any way.
As the Transform and Opacity operations are done independently, their output can be routed elsewhere. The output of MergeOpacity would be something like a "FG only" option, including the opacity and transformation changes, without the background.
As you can see, if we didn't want or need a separate Transform output, we could lose the Transform node and just do both the transformation and the opacity in one Merge, and output both from there prior to doing the actual composite.
So here's an alternative method, which uses fewer nodes because it doesn't provide a separate transform-only output. You could use two Merge nodes, with one being an Instance (linked copy) of the other. One you merge over an Alpha=0 background, and the output of that is your 'FG only'. The other is your actual composite:

Whatever you do in MergeComposite2 will be automatically mirrored in Instance_MergeComposite2, but because the instance is merged over a Background with RGBA = 0,0,0,0, only the foreground is affected in that case.
This does depend on the Blend mode used. For example if you wanted to use Multiply in MergeComposite2, the image coming from the Instance_MergeComposite2 would be pure black, because multiplying any pixel value by 0 will give 0.
Therefore I would de-instance Blend Mode and set Instance_MergeComposite2 to Normal blend mode. With that done, the Instance_MergeComposite2 would always be the FG only after transformation and opacity adjustments, regardless of the blend mode used in MergeComposite2.
If you felt this 'FG only' output was something you needed a lot, you could make a Macro of either of the above two methods, which could then be deployed as a single node and could have multiple outputs, one being the normal, full Merge output, the other being the "FG only" (meaning after transform and opacity, before composite).
There may well be other, perhaps more elegant ways to achieve what you want, so if you give a real life example of what you're trying to achieve, maybe we can help more specifically.
Node code for method one:
- Code: Select all
{
Tools = ordered() {
TextForeground = TextPlus {
NameSet = true,
Inputs = {
GlobalOut = Input { Value = 100, },
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
StyledText = Input { Value = "fusion", },
Font = Input { Value = "Open Sans", },
Style = Input { Value = "Bold", },
VerticalJustificationNew = Input { Value = 3, },
HorizontalJustificationNew = Input { Value = 3, },
ManualFontKerningPlacement = Input {
Value = StyledText {
Array = {
},
Value = ""
},
},
},
ViewInfo = OperatorInfo { Pos = { 1103.5, 469.276 } },
},
Transform8 = Transform {
Inputs = {
Input = Input {
SourceOp = "TextForeground",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 1103.5, 514.762 } },
},
BGAlpha0 = Background {
NameSet = true,
Inputs = {
GlobalOut = Input { Value = 100, },
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
TopLeftAlpha = Input { Value = 0, },
TopRightGreen = Input { Value = 1, },
BottomLeftBlue = Input { Value = 1, },
BottomRightRed = Input { Value = 1, },
BottomRightGreen = Input { Value = 1, },
},
ViewInfo = OperatorInfo { Pos = { 984.579, 564.203 } },
},
MergeOpacity = Merge {
NameSet = true,
Inputs = {
Background = Input {
SourceOp = "BGAlpha0",
Source = "Output",
},
Foreground = Input {
SourceOp = "Transform8",
Source = "Output",
},
PerformDepthMerge = Input { Value = 0, },
},
ViewInfo = OperatorInfo { Pos = { 1103.5, 564.203 } },
},
PipeRouter2_2 = PipeRouter {
Inputs = {
Input = Input {
SourceOp = "MergeOpacity",
Source = "Output",
},
},
ViewInfo = PipeRouterInfo { Pos = { 1225.55, 595.186 } },
},
MergeComposite = Merge {
NameSet = true,
Inputs = {
Background = Input {
SourceOp = "Background",
Source = "Output",
},
Foreground = Input {
SourceOp = "MergeOpacity",
Source = "Output",
},
PerformDepthMerge = Input { Value = 0, },
ReferenceSize = Input { Value = 1, },
},
ViewInfo = OperatorInfo { Pos = { 1103.5, 611.008 } },
},
Background = Background {
NameSet = true,
Inputs = {
GlobalOut = Input { Value = 100, },
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
Type = Input { Value = FuID { "Corner" }, },
TopLeftRed = Input { Value = 1, },
TopRightGreen = Input { Value = 1, },
BottomLeftBlue = Input { Value = 1, },
BottomRightRed = Input { Value = 1, },
BottomRightGreen = Input { Value = 1, },
},
ViewInfo = OperatorInfo { Pos = { 980.449, 611.008 } },
},
PipeRouter2_1 = PipeRouter {
CtrlWZoom = false,
Inputs = {
Input = Input {
SourceOp = "Transform8",
Source = "Output",
},
},
ViewInfo = PipeRouterInfo { Pos = { 1231.35, 547.723 } },
}
}
}
Node code for method two:
- Code: Select all
{
Tools = ordered() {
TextForeground_2 = TextPlus {
NameSet = true,
Inputs = {
GlobalOut = Input { Value = 100, },
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
StyledText = Input { Value = "fusion", },
Font = Input { Value = "Open Sans", },
Style = Input { Value = "Bold", },
VerticalJustificationNew = Input { Value = 3, },
HorizontalJustificationNew = Input { Value = 3, },
ManualFontKerningPlacement = Input {
Value = StyledText {
Array = {
},
Value = ""
},
},
},
ViewInfo = OperatorInfo { Pos = { 573.647, 542.449 } },
},
Instance_MergeComposite2 = Merge {
NameSet = true,
SourceOp = "MergeComposite2",
Inputs = {
SettingsNest = Input { },
Background = Input {
SourceOp = "BGAlpha0",
Source = "Output",
},
Foreground = Input {
SourceOp = "TextForeground_2",
Source = "Output",
},
Merge = Input { },
ApplyMode = Input { },
Channels = Input { },
ReferenceSize = Input { Value = 1, },
CommentsNest = Input { },
FrameRenderScriptNest = Input { },
StartRenderScripts = Input { },
EndRenderScripts = Input { },
EffectMask = Input { }
},
ViewInfo = OperatorInfo { Pos = { 667.915, 585.957 } },
},
MergeComposite2 = Merge {
CtrlWZoom = false,
NameSet = true,
Inputs = {
Background = Input {
SourceOp = "Background21",
Source = "Output",
},
Foreground = Input {
SourceOp = "TextForeground_2",
Source = "Output",
},
ApplyMode = Input { Value = FuID { "Multiply" }, },
FilterMethod = Input { Value = 3, },
PerformDepthMerge = Input { Value = 0, },
ReferenceSize = Input { Value = 1, },
},
ViewInfo = OperatorInfo { Pos = { 573.647, 630.784 } },
},
Background21 = Background {
NameSet = true,
Inputs = {
GlobalOut = Input { Value = 100, },
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
Type = Input { Value = FuID { "Corner" }, },
TopLeftRed = Input { Value = 1, },
TopRightGreen = Input { Value = 1, },
BottomLeftBlue = Input { Value = 1, },
BottomRightRed = Input { Value = 1, },
BottomRightGreen = Input { Value = 1, },
},
ViewInfo = OperatorInfo { Pos = { 453.492, 630.784 } },
},
PipeRouter2 = PipeRouter {
Inputs = {
Input = Input {
SourceOp = "Instance_MergeComposite2",
Source = "Output",
},
},
ViewInfo = PipeRouterInfo { Pos = { 725.201, 630.784 } },
},
BGAlpha0 = Background {
NameSet = true,
Inputs = {
GlobalOut = Input { Value = 100, },
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
TopLeftAlpha = Input { Value = 0, },
TopRightGreen = Input { Value = 1, },
BottomLeftBlue = Input { Value = 1, },
BottomRightRed = Input { Value = 1, },
BottomRightGreen = Input { Value = 1, },
},
ViewInfo = OperatorInfo { Pos = { 786.617, 585.957 } },
}
}
}


