Overview
Expands or contracts white areas in a mask and cleans up small specks or holes. Use it to grow a selection slightly, remove thin noise, or adjust the edge of a transparent region.
The component selected by source is processed as continuous grayscale values
with min/max morphology; it is not binarized. Gray or translucent mask values
therefore remain meaningful in the result.
Usage tips
- Remember the four operations this way:
Dilate= expand,Erode= contract,Open= remove white specks (contract, then restore), andClose= fill holes (expand, then restore). - With wrapping off,
Closedoes not treat pixels outside the canvas as holes, so it preserves source shapes that touch a canvas edge. Preserve Originalis shown and applied only forClose. If an older file retains it for another operation, that value is ignored and a warning is shown.- Combinations that are necessarily empty, such as
Dilate+Removed, return an empty result and show a warning onOutput Region. - A go-to mask preprocessing step is to clean an automatically generated mask
(from
edge_detector a threshold node) once with Open / Close before using it. - Choose between this and
pixel_cleanupby scope: Pixel Cleanup for conservative, 1px-only cleanup; Morphology for full shaping with a specified radius.
Related nodes
pixel_cleanup— lightweight, 1px-only cleanupmask/mask_boolean— destinations for the cleaned maskdistance_field— another shaping approach based on distance from the boundaryoutline— a dedicated outline instead of one produced by expansion
Examples
- Use
Dilateto expand a character mask by 1px as the basis for an outline. - Use
Erodeto contract a mask slightly and remove bleeding along the edge. - Use
Opento remove small white noise dots. - Use
Closeto fill small holes in a filled area. - When processing a tile mask, enable
wrap_x/wrap_yso edge shapes connect to the opposite side.