Skip to content

Separate

Separate
Utility

Detects all disconnected foreground regions in an image and outputs each one as a clean cutout in a batch, cropped to its bounding box with the other objects’ pixels erased so every frame contains exactly one object. A Mode parameter chooses how the image is split: Connectivity (the default) detects disconnected objects as described here, while Grid ignores content and slices the image into a regular rows-by-columns grid of equal tiles (each side from 1 to 64), for chopping a sprite sheet or atlas into evenly sized frames. The input also accepts a grayscale or mask source directly (a single-channel input yields single-channel cutouts). Separate accepts a batch on its input too: feed it several frames and each one is analyzed in turn, fanning the per-object cutouts out into a single combined batch (an M×N expansion, capped per session to keep the output from running away).

PinTypeDescription
ImagePixels (required)The source image or mask to analyze; accepts color or grayscale, and a batch for per-frame fan-out
MaskMaskOptional matte marking the objects to cut out: white is kept content and black is the empty space between objects. Each connected white region becomes one cutout. When connected, it drives detection directly and overrides the Background parameter
BatchBatchOne frame per detected foreground object, named object_01, object_02, … (the object stem is set by the Name Prefix parameter) in the chosen sort order

Pins

ImagePixels
InputRequired
MaskMask
InputOptional
BatchBatch
Output

Mode

ModeChoice
Default: Connectivity
  • ConnectivityDetect and cut out separate objects, found by transparency, a corner color, a chosen color, or a mask. The default.
  • GridIgnore detection and slice the image into a regular grid of equal tiles (rows by columns), for chopping a sprite sheet or atlas into evenly sized frames.

Detection

BackgroundChoice
Default: Alpha

How background is detected

  • AlphaTreat transparent pixels (alpha = 0) as background.
  • Corner ColorSample a corner pixel and treat matching colors as background.
  • Custom ColorSpecify a color directly as the background reference.
CornerChoice
Default: Top-Left
Background = Corner Color

Which corner pixel to sample as the background reference color

  • Top-LeftSample the top-left pixel as the background reference.
  • Bottom-RightSample the bottom-right pixel as the background reference.
ColorColor (RGB)
Default: rgb(255, 255, 255)
Background = Custom Color

Background reference color

ThresholdInteger
Default: 1 Range: 1–255
  • Alpha mode: pixels with alpha above this are content.
  • Color modes: maximum color distance from the reference color to still count as background (higher tolerates anti-aliasing halos / JPEG fringing).
Merge Gap (px)Integer
Default: 0 Range: 0–100

Expand the foreground mask by this many pixels before detecting regions, to merge objects that are nearly - but not quite - touching (e.g. a leaf with a thin transparent gap through it)

Filter

Min Area (px²)Integer
Default: 64 Range: 1–100000

Regions smaller than this area are ignored (dust, compression artefacts)

Max ObjectsInteger
Default: 0 Range: 0–2048

Hard cap on output frames. 0 = unlimited

Grid

RowsInteger
Default: 2 Range: 1–64
Mode = Grid

Number of horizontal bands to slice from the input image

ColumnsInteger
Default: 2 Range: 1–64
Mode = Grid

Number of vertical bands to slice from the input image

Output

Padding (px)Integer
Default: 0 Range: 0–500

Extra pixels kept around each cropped bounding box

Sort ByChoice
Default: Reading Order

Order of the output frames. Reading Order scans left-to-right, top-to-bottom like a grid

  • Left → RightOrder objects by their left edge, leftmost first.
  • Top → BottomOrder objects by their top edge, topmost first.
  • Reading OrderScan left-to-right, top-to-bottom, like reading a page.
  • Largest FirstSort by bounding-box area, largest object first.
  • Smallest FirstSort by bounding-box area, smallest object first.
Name PrefixText
Default: object

Prefix for each output frame's name. Frames are named <prefix>_NN (zero-padded to the object count) - e.g. object_01, object_02 - which feeds the {name} token in Export Batch filenames and the filmstrip label. Leave empty for just the zero-padded number (01, 02 ...)

Mask

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

How the connected color image is read as a mask. Luminance: the image's brightness. Alpha: the image's transparency. Red / Green / Blue: a single channel

  • 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.
Mask FitChoice
Default: Stretch
Mask connected

How the mask is mapped when it doesn't match the image

  • None (native size)Center the mask at its native size, with no resizing. Unmasked regions are unaffected.
  • StretchStretch the mask to exactly match the image dimensions. May distort the mask shape.
  • Fit (letterbox)Scale the mask to fit inside the image, preserving aspect ratio. Letterboxes where needed.
  • Fill (crop)Scale the mask to fill the image, preserving aspect ratio. Crops edges if aspect ratios differ.
  • Wire the Batch output into Scatter to use each detected object as a stamp, or into Export Batch to save each one as a separately named file.
  • Use Merge Gap to close small transparent gaps within a single object before detection. A leaf with a thin transparent seam through it becomes one cutout instead of two.
  • Min Area filters out dust and JPEG compression artifacts that would otherwise produce extra frames. Raise it until only real objects remain.
  • Padding adds breathing room around each cutout. Useful when downstream nodes need a few pixels of context around the edge.
  • Max Objects caps the output count when you only need the N largest or leftmost objects from a large image.
  • Reading Order sorts objects as a human would read text: left-to-right, top-to-bottom across rows.
  • Set Name Prefix to control each frame’s name stem (leaf_01, leaf_02, …). Leave it empty to emit just the zero-padded number.
  • On a single-input graph, the Export Batch {source} token resolves to the upstream origin label (e.g. tree) rather than object_NN, so {source}_{name} keeps fan-out filenames readable.