DerekVFX LogoDerekVFX

Blog

Nuke

Projects

Photography

Filmography

OCIO.ccExternal link

DerekVFX LogoDerekVFX

©2009 - 2026 DerekVFX

ContactIMDBLinkedInGitHubOCIO.ccExternal link
←ToolSets / Lens

Vignette

Lens2025-01-13ToolSets/lens/vignette.nk
View on GitHub

Radial falloff expression with midpoint, roundness, feather, highlight recovery, and highlight vs color priority.

Vignette builds a radial profile in Expression (distance from center with roundness/aspect), remaps it with midpoint and feather, multiplies in Cineon, and can preserve lightness via an LCH path when color priority is selected.

Amount can go either way (add or remove falloff). Highlight recovery protects bright centers. Closer to optical falloff than a soft black radial grade.

Script Code

set cut_paste_input [stack 0]
version 9.0 v7
push $cut_paste_input
Group {
name vignette
tile_color 0x421010ff
selected true
xpos 321
ypos 27
addUserKnob {20 User l vignette}
addUserKnob {4 priority M {"highlight priority" "color priority" "" "" ""}}
addUserKnob {7 amount R -1 1}
amount -0.4
addUserKnob {7 midpoint R -1 1}
addUserKnob {7 roundness R -1 1}
addUserKnob {7 feather}
feather 0.2
addUserKnob {7 highlights l "highlight recovery"}
highlights 0.2
addUserKnob {26 ""}
addUserKnob {26 lbl l "" +STARTLINE T "Vignette v1.3"}
addUserKnob {22 btn l DerekVFX.ca T "nuke.tcl('start', 'https://derekvfx.ca')" +STARTLINE}
}
Input {
inputs 0
name Input
xpos 447
ypos 61
}
set Nf274b000 [stack 0]
push $Nf274b000
Dot {
name Dot4
xpos 239
ypos 178
}
set Nf274ac00 [stack 0]
Dot {
name Dot5
xpos -13
ypos 178
}
set Nf274a800 [stack 0]
Colorspace {
colorspace_out Cineon
name Colorspace1
xpos -170
ypos 239
}
Expression {
temp_name0 avg
temp_expr0 (r+g+b)/3
expr3 smoothstep(1/avg,0,pow(highlights,2.4))
name Expression2
xpos -170
ypos 305
}
push $Nf274a800
Expression {
temp_name0 radial
temp_expr0 "sqrt((x*round-(w*round)/2)**2 + ((y/round)/pax-((h/round)/pax)/2)**2)/diagonal"
temp_name1 remap
temp_expr1 lerp(clamp(smoothstep(mp,1,radial)),clamp(lerp(0,1-mp,radial)),feather)
temp_name2 profile
temp_expr2 1/(((remap)**2)+1)
temp_name3 o
temp_expr3 lerp(profile,profile*-1+2,(amount*2+1)/2)
expr0 o
expr1 o
expr2 o
expr3 remap
name Expression1
selected true
xpos -47
ypos 283
addUserKnob {20 User}
addUserKnob {7 round l roundness}
round {{lerp(-1,.9,1,1.1,roundness)}}
addUserKnob {7 mp}
mp {{lerp(-1,0,1,1,midpoint)}}
addUserKnob {7 le l "long edge"}
le {{"(w >= h ? w : h)"}}
addUserKnob {7 diagonal R 0 4000}
diagonal {{(sqrt(w**2+h**2)/2)}}
addUserKnob {7 aspect R 0.5 2.5}
aspect {{input.width/input.height}}
addUserKnob {7 w R 0 4000}
w {{input.width}}
addUserKnob {7 h R 0 4000}
h {{input.height}}
addUserKnob {7 pax R 0 2}
pax {{input.pixel_aspect}}
}
push $Nf274ac00
Merge2 {
inputs 2+1
operation multiply
output {rgba.red rgba.green rgba.blue -rgba.alpha}
name Merge1
xpos -47
ypos 416
}
set Nfc9eb000 [stack 0]
Colorspace {
colorspace_out CIE-LCH
name Colorspace2
xpos 94
ypos 590
}
set Cfc9eac00 [stack 0]
push $Nf274ac00
clone $Cfc9eac00 {
xpos 205
ypos 589
selected false
}
Copy {
inputs 2
from0 rgba.red
to0 rgba.red
name Copy1
xpos 205
ypos 666
}
Colorspace {
colorspace_in CIE-LCH
name Colorspace3
xpos 205
ypos 725
}
push $Nfc9eb000
Dot {
name Dot1
xpos -13
ypos 913
}
Switch {
inputs 2
which {{priority}}
name Switch1
xpos 205
ypos 909
}
CopyBBox {
inputs 2
name CopyBBox1
xpos 447
ypos 997
}
Output {
name Output1
xpos 447
ypos 1055
}
end_group