This node uses the mask (alpha) input to drive defocus intensity. The defocus scales linearly from 0% at black to 100% at white.
Developed on Windows and production-tested on Linux (Nuke 16.0). Any feedback is welcome.
This node uses the mask (alpha) input to drive defocus intensity. The defocus scales linearly from 0% at black to 100% at white.
Developed on Windows and production-tested on Linux (Nuke 16.0). Any feedback is welcome.
First submitted: 22 March 2026
Updated: 23 March 2026
Author: Andras Szocs
Website: http://andrasszocs.com
Compatible Nuke versions: 16.0 or later
Compatibility: Source
iDefocusPro
An image-driven defocus tool designed for intuitive control without the complexity of a ZDefocus setup. It uses a simple mask input (alpha) to drive the defocus amount, making it ideal for cases where you need to create depth of field using manual gradients or ML-generated depth maps.
Knobs:
Iterations: Defines the number of discrete 'slices' the alpha channel is divided into. Each slice is assigned a unique defocus value; increasing this count results in a smoother, more accurate gradient. Range: 1 (standard masked defocus) to 256 (maximum precision, where every shade in the alpha receives a specific defocus level).
Defocus controls: Standard defocus parameters (channels, defocus, aspect ratio, scaling, quality, method) applied to the slices to simulate realistic lens bokeh.
Production Use Cases:
Manual Depth-of-Field: Perfect for adding realistic lens blur when a proper Z-depth pass is unavailable. Simply use a Roto-gradient or an ML-generated depth map to drive the effect.
Intuitive Workflow: Avoids the "fiddling" often required by ZDefocus (focal point, DoF, etc.). If your mask is white, it's defocused; if it's black, it's sharp.
See also: iBlurPro and iTransformPro
Free for personal and commercial use. Please keep the original author's name in the source code.
Comments