Skip to content

Mask Refine

Node icon
Mask

Refines a mask with erode, dilate, feather, threshold, and morphological operations.

Mask Refine is the primary tool for cleaning up and adjusting masks. Erode shrinks the mask (positive values) or dilates it (negative values). Feather applies a Gaussian blur for soft edges. Threshold binarizes the mask.

The morphology section offers advanced operations: Open (removes small noise), Close (fills small holes), Gradient (extracts edges), Top Hat (bright detail), and Black Hat (dark detail).

With an image connected, a Transparent RGB section offers Extend Transparent RGB, which fills the color underneath fully transparent pixels with nearby edge color instead of leaving it undefined. This matters for straight-alpha texture export, external mip generation, and any downstream tool that reads the RGB of a transparent pixel: without it, those tools pull black (or whatever happened to be there) into the edges of your artwork.

A Radius control sets how far the fill reaches. If an Erode or Morphology setting already needs more reach than that, the larger of the two is used. The option starts off, so existing projects are unchanged.

ArcBrush’s own Resize and Transform resample premultiplied and do not need this; it is for what happens after the image leaves ArcBrush.

Pins

ImageImage
InputOptional
MaskMask
InputOptional
ImageImage
Output
MaskMask
Output

Mask

ThresholdToggle
Default: false

Binarize the mask before refinement

Threshold ValueInteger
Default: 128 Range: 0–255
When Threshold is on

Binarization cutoff (pixels >= become white)

Erode / DilateNumber · px/%
Default: 0.0 Range: -50.0–50.0 px / -100–100%

Positive: erode (shrink). Negative: dilate (expand)

FeatherNumber · px/%
Default: 1.5 Range: 0.0–50.0 px / 0–100%

Gaussian blur radius on mask edges

InvertToggle
Default: false

Invert the mask

Mask FromChoice
Default: Luminance
Color image connected to the mask input

How the connected color image is read as a mask

  • LuminanceRead the image's brightness as the mask. The default.
  • AlphaRead the image's transparency as the mask.
  • RedUse the red channel as the mask.
  • GreenUse the green channel as the mask.
  • BlueUse the blue channel as the mask.

Morphology

OperationChoice
Default: None

Additional morphological op (Open/Close/Gradient/Top Hat/Black Hat)

  • NoneNo morphological operation, so only erode, feather, and threshold apply.
  • OpenErode then dilate, removing small noise and thin protrusions while preserving overall shape.
  • CloseDilate then erode, filling small holes and gaps while preserving overall shape.
  • GradientDifference between dilation and erosion, extracting the edge/outline of the mask.
  • Top HatDifference between input and opening, isolating bright details smaller than the kernel.
  • Black HatDifference between closing and input, isolating dark details smaller than the kernel.
Kernel ShapeChoice
Default: Ellipse
When Operation != None

Structuring element shape

  • RectangleSquare structuring element that affects pixels in a rectangular area.
  • EllipseCircular structuring element for the most natural-looking morphological operations.
  • CrossCross-shaped structuring element that affects only pixels along horizontal and vertical axes.
Kernel Size (px)Integer
Default: 3 Range: 1–100
When Operation != None

Kernel radius in pixels

IterationsInteger
Default: 1 Range: 1–10
When Operation != None

How many times to repeat the operation

Transparent RGB

Extend Transparent RGBToggle
Default: false
Image input connected

Stores edge color beneath fully transparent pixels, for straight-alpha texture export, external mip generation, and downstream tools that read transparent RGB.

ArcBrush's own Resize and Transform already resample premultiplied and do not need this.

Radius (px)Integer
Default: 16 Range: 1–128
Image input connected and Extend Transparent RGB on

Minimum extension radius. Automatic alpha-expanding operations may extend further

  • A small erode (1–2px) removes fringe pixels at mask edges.
  • Negative erode values dilate (expand) the mask, which is useful for extending selections.
  • Use Open to clean up noisy masks without changing the overall shape.
  • Close fills small holes in masks and works well for patching gaps in selections.
  • Use Feather to soften hard mask edges into a smooth falloff.
  • Turn on Extend Transparent RGB as the last step before exporting a straight-alpha game texture, so the engine’s mip chain does not bleed black into cut-out edges.