FrameBlendMerge

January 24, 2016
THE PROBLEM

This tool came about as an alternative way of generating a cleanplate. I was working with footage that had a lot of falling snow, and needed to remove it to leave just the background.

My Auto Cleanplate tool would not work as the snow particles were too small to track with optical flow.
Doing any time-based blending of frames would not work, as FrameBlend would leave bright streaks through the shot.

I figured that because everything that I wanted to remove was brighter than the background, I could merge a number of frames using a “min” operation. The FrameBlend does not allow for different operations other than averaging between all input frames. I needed a way to automatically blend a large number of frames, but using an operation other than just “over” – a way of combining a FrameBlend with a Merge.

THE SOLUTION

The solution is pretty crude, but does the trick. I created a gizmo that takes a frame range and an operation as it’s input.

When you hit the “update” button, a script loops through and creates a FrameHold for every frame in the range. These are then all attached as inputs to a single Merge node, which has our selected operation set as its blending mode.

I applied this to my falling snow footage and created a cleanplate by blending 20 frames.

THE NUKE NODE

Here is the GitHub link for the node – just select the text, copy it then, then paste it into Nuke.

ADDITIONAL CONSIDERATIONS

Using a ‘min’ operation works great for removing bright parts of the image from a dark background (fire, sparks, white smoke etc.), but with a ‘max’ operation could just as easily remove dark objects (birds flying against a bright sky etc.). I have included all of the available operations available in a Merge node, as there may be many scenarios where different operations will work better for a specific task.

Since creating this tool I came across FrameMedian by Mads Hagbarth. This uses mathematical averaging over a frame range to achieve a similar result. His tool is very well made and will, in many cases, create a better result.






One Response to "FrameBlendMerge"

Chris Charlton says: February 4, 2016 at 2:33 pm

Try this instead, it is a stackable Temporal Median Chain I created. Great for generateing clean plates. For best results ensure the footage is stablised, and the grade is consistent. It will find the median (the most common pixel value) for up to 10 frame in front and behind in the time line. And it can be stacked using the User Controls (e.g. 1 for first chain, 2 for second chain and so on…). Be mindful this can be very process heavy, hence why I created it to be stackable. I’ll be turning it into a gimzo soon… only just finished the proto-type tonight.

Enjoy.

set cut_paste_input [stack 0]
version 7.0 v6
BackdropNode {
inputs 0
name BackdropNode1
tile_color 0xaaaaaa00
label “Temporal Median Chain”
note_font_size 42
selected true
xpos -3316
ypos -2342
bdwidth 661
bdheight 1497
}
push $cut_paste_input
Dot {
name Dot125
selected true
xpos -3086
ypos -2262
}
set N40b017f0 [stack 0]
Dot {
name Dot158
selected true
xpos -3086
ypos -2214
}
set N3580e240 [stack 0]
TimeOffset {
time_offset {{“1 + (5 * (MedianChainSwitch.MedianChain – 1))”}}
name TimeOffset803
selected true
xpos -3010
ypos -2217
}
set N355f5360 [stack 0]
push 0
push $N3580e240
TimeOffset {
time_offset {{“-(1 + (5 * (MedianChainSwitch.MedianChain – 1)))”}}
name TimeOffset62
selected true
xpos -3230
ypos -2217
}
set N372fc3a0 [stack 0]
push $N3580e240
Merge2 {
inputs 3+1
operation plus
name Merge167
selected true
xpos -3120
ypos -2073
}
push $N355f5360
push 0
push $N372fc3a0
push $N3580e240
Merge2 {
inputs 3+1
operation max
name Merge168
selected true
xpos -3230
ypos -2145
}
Merge2 {
inputs 2
operation minus
name Merge169
selected true
xpos -3230
ypos -2073
}
Dot {
name Dot159
selected true
xpos -3196
ypos -1998
}
push $N355f5360
push 0
push $N372fc3a0
push $N3580e240
Merge2 {
inputs 3+1
operation min
name Merge170
selected true
xpos -3010
ypos -2145
}
Dot {
name Dot160
selected true
xpos -2976
ypos -1998
}
Merge2 {
inputs 2
operation minus
name Merge171
selected true
xpos -3120
ypos -2001
}
set N3580fa50 [stack 0]
Dot {
name Dot112
selected true
xpos -3086
ypos -1950
}
set N3799b3f0 [stack 0]
TimeOffset {
time_offset {{“2 + (5 * (MedianChainSwitch.MedianChain – 1))”}}
name TimeOffset65
selected true
xpos -3010
ypos -1953
}
set N372fd090 [stack 0]
push 0
push $N3799b3f0
TimeOffset {
time_offset {{“-(2 + (5 * (MedianChainSwitch.MedianChain – 1)))”}}
name TimeOffset66
selected true
xpos -3230
ypos -1953
}
set N372fd4e0 [stack 0]
push $N3799b3f0
Merge2 {
inputs 3+1
operation plus
name Merge87
selected true
xpos -3120
ypos -1809
}
push $N372fd090
push 0
push $N372fd4e0
push $N3799b3f0
Merge2 {
inputs 3+1
operation max
name Merge88
selected true
xpos -3230
ypos -1881
}
Merge2 {
inputs 2
operation minus
name Merge89
selected true
xpos -3230
ypos -1809
}
Dot {
name Dot113
selected true
xpos -3196
ypos -1734
}
push $N372fd090
push 0
push $N372fd4e0
push $N3799b3f0
Merge2 {
inputs 3+1
operation min
name Merge90
selected true
xpos -3010
ypos -1881
}
Dot {
name Dot114
selected true
xpos -2976
ypos -1734
}
Merge2 {
inputs 2
operation minus
name Merge91
selected true
xpos -3120
ypos -1737
}
set N3799cc00 [stack 0]
Dot {
name Dot116
selected true
xpos -3086
ypos -1686
}
set N3799d2e0 [stack 0]
TimeOffset {
time_offset {{“3 + (5 * (MedianChainSwitch.MedianChain – 1))”}}
name TimeOffset67
selected true
xpos -3010
ypos -1689
}
set N372fd930 [stack 0]
push 0
push $N3799d2e0
TimeOffset {
time_offset {{“-(3 + (5 * (MedianChainSwitch.MedianChain – 1)))”}}
name TimeOffset68
selected true
xpos -3230
ypos -1689
}
set N372fc7f0 [stack 0]
push $N3799d2e0
Merge2 {
inputs 3+1
operation plus
name Merge92
selected true
xpos -3120
ypos -1545
}
push $N372fd930
push 0
push $N372fc7f0
push $N3799d2e0
Merge2 {
inputs 3+1
operation max
name Merge93
selected true
xpos -3230
ypos -1617
}
Merge2 {
inputs 2
operation minus
name Merge94
selected true
xpos -3230
ypos -1545
}
Dot {
name Dot117
selected true
xpos -3196
ypos -1470
}
push $N372fd930
push 0
push $N372fc7f0
push $N3799d2e0
Merge2 {
inputs 3+1
operation min
name Merge95
selected true
xpos -3010
ypos -1617
}
Dot {
name Dot118
selected true
xpos -2976
ypos -1470
}
Merge2 {
inputs 2
operation minus
name Merge96
selected true
xpos -3120
ypos -1473
}
set N3799eaf0 [stack 0]
Dot {
name Dot103
selected true
xpos -3086
ypos -1422
}
set N3799f1d0 [stack 0]
TimeOffset {
time_offset {{“4 + (5 * (MedianChainSwitch.MedianChain – 1))”}}
name TimeOffset69
selected true
xpos -3010
ypos -1425
}
set N372fb6b0 [stack 0]
push 0
push $N3799f1d0
TimeOffset {
time_offset {{“-(4 + (5 * (MedianChainSwitch.MedianChain – 1)))”}}
name TimeOffset70
selected true
xpos -3230
ypos -1425
}
set N372fea70 [stack 0]
push $N3799f1d0
Merge2 {
inputs 3+1
operation plus
name Merge72
selected true
xpos -3120
ypos -1281
}
push $N372fb6b0
push 0
push $N372fea70
push $N3799f1d0
Merge2 {
inputs 3+1
operation max
name Merge73
selected true
xpos -3230
ypos -1353
}
Merge2 {
inputs 2
operation minus
name Merge74
selected true
xpos -3230
ypos -1281
}
Dot {
name Dot104
selected true
xpos -3196
ypos -1206
}
push $N372fb6b0
push 0
push $N372fea70
push $N3799f1d0
Merge2 {
inputs 3+1
operation min
name Merge75
selected true
xpos -3010
ypos -1353
}
Dot {
name Dot105
selected true
xpos -2976
ypos -1206
}
Merge2 {
inputs 2
operation minus
name Merge81
selected true
xpos -3120
ypos -1209
}
set N40afd6a0 [stack 0]
Dot {
name Dot108
selected true
xpos -3086
ypos -1158
}
set N40afdd80 [stack 0]
TimeOffset {
time_offset {{“5 + (5 * (MedianChainSwitch.MedianChain – 1))”}}
name TimeOffset71
selected true
xpos -3010
ypos -1161
}
set N372fcc40 [stack 0]
push 0
push $N40afdd80
TimeOffset {
time_offset {{“-(5 + (5 * (MedianChainSwitch.MedianChain – 1)))”}}
name TimeOffset72
selected true
xpos -3230
ypos -1161
}
set N372ff310 [stack 0]
push $N40afdd80
Merge2 {
inputs 3+1
operation plus
name Merge82
selected true
xpos -3120
ypos -1017
}
push $N372fcc40
push 0
push $N372ff310
push $N40afdd80
Merge2 {
inputs 3+1
operation max
name Merge83
selected true
xpos -3230
ypos -1089
}
Merge2 {
inputs 2
operation minus
name Merge84
selected true
xpos -3230
ypos -1017
}
Dot {
name Dot109
selected true
xpos -3196
ypos -942
}
push $N372fcc40
push 0
push $N372ff310
push $N40afdd80
Merge2 {
inputs 3+1
operation min
name Merge85
selected true
xpos -3010
ypos -1089
}
Dot {
name Dot110
selected true
xpos -2976
ypos -942
}
Merge2 {
inputs 2
operation minus
name Merge86
selected true
xpos -3120
ypos -945
}
push $N40afd6a0
push $N3799eaf0
push $N3799cc00
push $N3580fa50
push $N40b017f0
Dot {
name Dot126
selected true
xpos -2756
ypos -2262
}
Switch {
inputs 6
name MedianChainSwitch
selected true
xpos -2790
ypos -945
addUserKnob {20 User}
addUserKnob {3 MedianChain}
MedianChain 1
}
Dot {
name Dot111
selected true
xpos -2756
ypos -894
}

Leave a comment

required