Defocus

Defocuses the image using a disc filter. This allows you to simulate the defocusing effect of a circular lens and create lens blur effects like ’bokeh’ (the blooming of highlights when defocused).

To create lens blur effects that aren’t circular, use the Convolve node.

To simply blur an image or a matte, use the Blur node, which is faster than Defocus.

Inputs and Controls

Connection Type

Connection Name

Function

Input

unnamed

The image sequence to defocus.

Control (UI)

Knob (Scripting)

Default Value

Function

Defocus Tab

channels

channels

all

The defocus effect is only applied to these channels.

If you set this to something other than all or none, you can use the checkboxes on the right to select individual channels.

defocus

defocus

1

Sets the size of the defocus disc used.

aspect ratio

ratio

1

Adjusts the width of the defocus disc without altering its height.

scaling

scale

1

Scales the defocus disc simultaneously on the x and y axes. You can also split the scaling into separate width and height controls.

quality

quality

20

Sets the interpolation used to smooth out the discs. Higher values produce better results, but take longer to render.

method

method

accelerated

Sets the mode of operation:

accelerated - faster than fullprecision mode, especially for large defocus disks.

fullprecision - delivers perfect defocus at the cost of performance.

Note:  Accelerated mode may generate speckles in horizontal lines due to imprecisions in the computer math. Normally, those speckles are invisible to the eye (delta < 0.00001), but they can cause artifacts in nodes that use comparison math (that is, if (src.red==0) ...). You can use fullprecision to avoid this speckling, but there is a significant render time increase.

mask

N/A

disabled

Enables the associated mask channel to the right. Disabling this checkbox is the same as setting the channel to none.

maskChannelInput

none

The channel to use as a mask. By default, the filter effect is limited to the non-black areas of this channel.

inject

inject

disabled

Copies the mask input to the predefined mask.a channel. Injecting the mask allows you to use the same mask further downstream.

invert

invert_mask

disabled

Inverts the use of the mask channel so that the filter effect is limited to the non-white areas of the mask.

fringe

fringe

disabled

When enabled, only apply the effect to the edge of the mask.

When disabled, the effect is applied to the entire mask.

mix

mix

1

Dissolves between the original image at 0 and the full effect at 1.