Filters

Basic Filters Tool

The basic Filters tool lets you apply several simple filters to your image. This can be very useful for data denoising; however, the real measured data will get altered in the process, so great care should be taken not to destroy important features of the image.

All filters alter the data based on the values in the neighbourhood of the filtered pixel. For some filters the size and shape of the neighbourhood is fixed. For most, however, the size can be controlled with parameter Size. Apart from Gaussian-based filters (described below) the size determines the diameter of the neighbourhood in pixels. It is thus advisable to use filters of odd sizes because their effect is symmetric.

Mean value
The filtered value is the mean value of the neighbourhood of the original pixel.
Median value
The filtered value is the median value of the neighbourhood of the original pixel.
Conservative denoise
The filter checks whether the value is the extreme within its neighbourhood. Non-extreme values are preserved. Extreme values are replaced by the second highest (lowest) values.
Minimum
Also known as erosion filter, it replaces values by the minimum found in the neighbourhood. Specifically, the erosion is performed with a flat disc of specified diameter.
Maximum
Also known as dilation filter, it replaces values by the maximum found in the neighbourhood. Specifically, the dilation is performed with a flat disc of specified diameter.
Opening
Opening is erosion followed by dilation. Positive bumps are thus removed from the surface, while smooth areas and negative bumps (holes) are more or less preserved.
Closing
Closing is dilation followed by erosion. Negative bumps (holes) are thus removed from the surface, while smooth areas and positive bumps are more or less preserved.
ASF opening
A simple opening or closing filter may be too rough for correction of defects of varying sizes. The alternating sequential filter (ASF) consists of a sequence of closing and opening operations with progressively increasing discs up to the given size. It preserves better the shape of features that should not be removed by the opening. The final operation of this filter is opening.
ASF closing
The ASF closing filter differs from the ASF opening filter only by the order of the elementary operations. The final operation of this filter is closing.
Kuwahara
Kuwahara filter is an edge-preserving smoothing filter.
Dechecker
A simple slightly smoothing filter specially designed to remove checker pattern from the image while preserving other details. It is a convolution filter with kernel
Dechecker filter 5 × 5 coefficient matrix
Gaussian
The Gaussian filter is a smoothing filter, the size parameter determines the FWHM (full width at half maximum) of the Gaussian. The relation between FWHM and σ is
FWHM-sigma relation for Gaussian
Sharpen
A simple sharpening operation which is complementary to the Gaussian filter. First it smooths the image further with the corresponding Gaussian filter. The result is then extrapolated backwards to estimate the sharper image.

By default, these filters will be applied to the entire image. However, you can apply a filter to a specific region within your image by selecting it with the mouse. This can be useful for correcting poorly measured areas within a good image.

It is also possible to limit the area by masking. In this case the mask determines the active pixels whose values will be modified by the filter. Pixels in the neighbourhood of the active area can however still enter the calculation passively, i.e. their values can influence the result.

Several of the basic filters can be used for simple denoising and defect removal. Further defect marking and removal functions are described in section Data Edit, see for instance Mask of Outliers and Remove Data Under Mask. More advanced denoising functions in Gwyddion, for example DWT denoising and FFT filtering, are described in section Extended Data Edit.

Screenshot of filter tool with median filter applied to a rectangular selection

Convolution

Data ProcessIntegral TransformsConvolution Filter

Convolutions with arbitrary kernels up to 9 × 9 can be performed using Convolution Filter.

The Divisor entry represents a common factor all the coefficients are divided by before applying the filter. This allows to use denormalized coefficients that are often nicer numbers. The normalization can be also calculated automatically when automatic is checked. When the sum of the coefficients is non-zero, it makes the filter sum-preserving, i.e. it normalizes the sum of coefficients to unity. When the sum of the coefficients is zero, the automatic factor is simply let equal to 1.

Since many filters used in practice exhibit various types of symmetry, the coefficients can be automatically completed according to the selected symmetry type (odd, even). Note the completion is performed on pressing Enter in the coefficient entry.

In a fresh installation only a sample Identity filter is present (which is not particularly useful as it does nothing). This filter cannot be modified, to create a new filter use the New button on the Presets page.