Grow or shrink the shapes in an image by a set radius. Dilation and erosion are the two basic operations of mathematical morphology, and between them they cover a set of jobs that otherwise need a brush: thickening the lines of a scanned drawing, trimming the fringe off a cutout, closing the gaps in a mask, or clearing dust from a threshold.
Dilate, erode, open, close, gradient
Every pixel looks at its neighbours within the radius. Dilate keeps the brightest, so bright and opaque regions expand into their surroundings. Erode keeps the darkest, so they contract. Run one after the other and small things vanish while large ones keep their size: Open (erode, then dilate) drops bright specks smaller than the radius, Close (dilate, then erode) fills dark holes and joins broken lines. Gradient subtracts the eroded picture from the dilated one, which leaves a band the width of the radius along every edge.
Lines on paper
A pen drawing is dark ink on light paper, so the operation names run the other way from what the task sounds like: Erode makes the lines thicker, because the dark areas grow, and Dilate makes them thinner. To clean a scan, switch Work on to black and white, set the threshold so the paper is white and the ink black, and then Close with a small radius to mend the strokes the scanner broke.
Masks and cutouts
With Work on set to Transparency the operation runs on the alpha channel. Erode by half a percent takes the semi-transparent halo off a cutout from a background remover. Dilate grows a logo outward for a sticker border; the grown pixels take the colour of the nearest edge pixel, so the border is the logo’s own colour and not black. Open removes the stray specks a chroma key leaves in the screen, and Close fills pinholes in the subject.
Radius
Radius is a share of the shorter side, so 1 percent is 15 pixels on a 1500 pixel photo and the download matches the preview. The neighbourhood is a disc, so corners round off as they grow. On the transparency and black-and-white modes it is an exact disc with an anti-aliased edge, computed through a distance transform. On the colour channels it is a regular octagon, which runs in the same time at any radius where an exact disc would slow down with the square of it; at picture sizes the two are indistinguishable.
Colour channels
In the default mode each of the red, green and blue channels is filtered on its own, which is what the Maximum and Minimum filters in an editor do. On a photo this spreads highlights (Dilate) or shadows (Erode) into their surroundings, a blocky, painterly look at large radii.