Defocus
Blurs the image with a lens disc (bokeh): defocus is the disc's radius in pixels, aspect ratio squeezes it.
Blurs the image with a lens disc (bokeh): defocus is the disc's radius in pixels, aspect ratio squeezes it. Highlights bloom into soft-edged discs.
| Node | Defocus |
|---|---|
| Menu | Filter › Defocus |
| Names in each format | |
| .oink comp (JSON) | "type": "OC_N_defocus" |
| .nk script | Defocus (how .nk import works) |
| Python | nuke.createNode("Defocus") |
| Assistant (MCP) | create_node(type="Defocus") |
| Tab search | defocus |

Inputs and outputs
| Port | Name | Type |
|---|---|---|
| input 0 | Image | image |
| input 1 | mask | image |
| output 0 | Image | image |
Knobs
Panel tab Defocus, in panel order.
| Knob | Label | Type | Default | Range / values | .nk knob | Description |
|---|---|---|---|---|---|---|
channels | channels | menu | all | rgba, rgb, alpha, all, none | Layer the op applies to: rgb, rgba, alpha, all, none, <layer> or <layer>.<ch> | |
defocus | defocus | float | 1 | 0 to 100 | defocus | |
ratio | aspect ratio | float | 1 | 0 to 3 | ratio | |
scale | scaling | wh ×2 | 1, 1 | 0 to 4 | scale | |
quality | quality | float | 20 | 1 to 100 (integer) | quality | |
method | method | menu | accelerated | accelerated, fullprecision (full precision) | method | |
mask_channel | mask | menu | none | none, rgba.alpha, rgba.red, rgba.green, rgba.blue | Mask channel, e.g. rgba.alpha (none = no mask) | |
inject | inject | bool | false | Copy the mask into mask.a for nodes downstream | ||
invert_mask | invert | bool | false | invert_mask | ||
fringe | fringe | bool | false | Only apply the effect at the edges of the mask | ||
mix | mix | float | 1 | 0 to 1 | mix |
Other knobs (Python, .nk and the assistant; not on the panel)
| Knob | Label | Type | Default | Range / values | .nk knob | Description |
|---|---|---|---|---|---|---|
gl_color | Viewer Controls Color | float ×3 | 0, 0, 0 | 0 to 1 | ||
postage_stamp_frame | Static Frame | int | 1 | -2147483648 to 2147483647 | ||
lifetimeStart | Lifetime Start | int | 0 | -2147483648 to 2147483647 | ||
lifetimeEnd | Lifetime End | int | 100 | -2147483648 to 2147483647 | ||
useLifetime | Use Lifetime | boolean | false | |||
cached | Cached | boolean | false | |||
bookmark | Bookmark | boolean | false | |||
dope_sheet | Dope Sheet | boolean | false | |||
clone_group | Clone Group | string | ||||
link_source | Link Source | string | ||||
link_overrides | Link Overrides | string | ||||
split_views | Split Views | string | ||||
unpremult | (Un)premult by | enum | none | none, rgba.alpha | ||
invert_unpremult | invert | boolean | false | (Un)premultiply by 1 - alpha |
Examples
Open these from Help › Examples…, or from the ? menu in this node's Properties panel.
- Defocus on bright highlights (
examples/filter/defocus_hdr.oink): Defocus spreads each pixel into a disc, so bright values over 1 turn into bokeh. BrightRings.exr has rings above 1000: a Blur would smear them, Defocus keeps hard-edged discs.
Glow2
Makes bright areas glow — the parts above tolerance are blurred (size, filter, quality as Blur), tinted, saturated, scaled by brightness and added to the image.
VectorBlur2
VectorBlur: motion blur along motion vectors — every pixel is smeared along its u / v vector (uv channels) times motion amount (0.5), over the shutter set by motion offset (-0.5 centres it).