Bilateral Filtering

The Bilateral node employs a smoothing filter that operates by mixing nearby source pixels according to their spatial distance and color similarity. Unlike the Blur node, this filter is particularly good at preserving edges, though it can be computationally expensive.

The Bilateral node includes GPU acceleration and an optional guide input to compute color similarity while filtering, which can be useful when scaling images.

Preserving Edges

The standard blurring employed by Nuke can destroy edges in images, particularly as the size of the blur increases. Bilateral features a number of controls that can help retain edges by giving more 'weight' to pixels at a given position or color value.

The default, low values for the Positional and Color Sigma only blend pixels that are close to each other and of a similar color, which can help preserve edges.

For example, adjusting the controls of the Bilateral node can help preserve edges in dense point clouds.

Blending in the 3D Viewer with no filter.

Blending using the Bilateral node.

Using the Guide Input

Bilateral's optional guide input can be connected to a depth map to improve filtering further using color similarity. The depth in the image helps Nuke to preserve edges using the extra information in the guide image.

The source image with no filter applied.

Blur Size 10 with a high Positional Sigma.

The same blur with Color Sigma adjusted.

Connecting the guide input converts the output from the filter to the same format as the guide image, resulting in a joint bilateral resampling filter. If the src and guide images have the same format, the node acts as a cross bilateral filter.

If the guide input is not connected, the output format is equal to that of the src input and acts as a standard bilateral filter.