Inpaint

Nuke's Inpaint is a time saving node for removing unwanted elements, such as tracking markers, blemishes, or wires. Inpaint uses surrounding pixels to fill an area marked in the alpha channel of the source image or Matte input. The Stretch controls bias the inpainting in a defined direction and the Detail controls allow for greater control and cloning of high frequency textures from another part of the source image, or even from a different image using the Detail input. Inpaint also benefits from GPU acceleration to provide fast results.

Inputs and Controls

Connection Type

Connection Name

Function

Input

Detail

The image sequence from which detail is applied to the inpainted area.

Matte

Controls which areas of the image are affected using the alpha channel or luminance.

Source

The image sequence to which the effect is applied.

Control (UI)

Knob (Scripting)

Default Value

Function

Inpaint Tab

Local GPU

gpuName

N/A

Displays the GPU used for rendering when Use GPU if available is enabled. Local GPU displays Not available when:

Use CPU is selected as the default blink device in the Preferences.

no suitable GPU was found on your system.

it was not possible to create a context for processing on the selected GPU, such as when there is not enough free memory available on the GPU.

You can select a different GPU, if available, by navigating to the Preferences and selecting an alternative from the default blink device dropdown.

Note:   Selecting a different GPU requires you to restart Nuke before the change takes effect.

Use GPU if available

useGPUIfAvailable

enabled

When enabled, rendering occurs on the Local GPU specified, if available, rather than the CPU.

Note:  Enabling this option with no local GPU allows the script to run on the GPU whenever the script is opened on a machine that does have a GPU available.
You should also select this if you wish to render from the command line with the --gpu option.

See Nuke 15 Release Notes for more information on the GPUs Nuke supports.

Channels

channels

rgb

The 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.

Fill Region

fillRegion

Source Alpha

Sets the Matte channel used to inpaint the Fill Region. Source pixels are sampled from outside this region and extended into the Fill Region.

None - do not use a matte.

Source Alpha - use the alpha of the Source input.

Source Inverted Alpha - use the inverted alpha of the Source input.

Matte Luminance - use the luminance of the Matte input.

Matte Inverted Luminance - use the inverted luminance of the Matte input.

Matte Alpha - use the alpha of the Matte input.

Matte Inverted Alpha - use the inverted alpha of the Matte input.

Smoothness

smoothness

1

Controls the smoothness of the inpainted area. Higher values can help to reduce flickering between frames, but at the expense of local detail.

L*a*b* Colorspace

LABColourSpace

disabled

When enabled, converts the inpainting to the LAB colorspace, which can improve the result.

Stretch

Amount

stretchAmount

0

Sets the amount of stretch applied to the edge pixels in the direction indicated by the Direction control.

Direction

stretchDirection

0

Sets the direction of stretch in degrees when Amount is set to any value greater than 0. You can use the direction to align linear features in the inpainted area, such as road markings or brick work.

Detail

Source

detailSource

Source

Sets where detail is recovered from, the Source input or the Detail input. This allows you to recover detail from another image entirely, such as a grain sample.

Amount

detailAmount

0

Controls the amount of high-frequency detail to add back into the inpainted area, where 0 is none and 1 is all the detail from the detail source. Values greater than 1 multiply the detail.

An example of detail you might want to recover is grain, which can be erased by inpainting.

Translate

translate

0,0

Controls the xy coordinates from which detail is recovered. If the Detail input is a different format to the Source input, you might not get the results you expect, but you can use the Detail Center to correct the offset of the Viewer widget.

Rotate

rotate

0

Sets the rotation of the detail recovered, in degrees, relative to the Detail Center controls. Adjusting the Detail Center changes the relative rotation.

Scale

scale

1

Sets the scale of the detail recovered relative to the Detail Center controls. Adjusting the Detail Center changes the relative scale.

Center

center

dependent on input format or compositing environment Project Settings

Sets the center of the detail so that changes to the translation, rotation, and scale are relative to the Detail Center.

This control defaults to the center of the Source format or the Project Settings > full size format control if no Source is connected.

Step-by-Step Guides

Removing Elements Using Inpaint