Skip to content

Selection ​

Selections define where subsequent operations apply: clearing, copying, transforming, gradients, fills, outlining, and capturing brushes. The editor uses a mask-based selection — selections can be any shape, not just rectangles, and the boolean modifiers compose them naturally.


Selection tools ​

Four ways to make a selection. Each becomes a coloured silhouette outline (purple dashed) on the canvas.

ToolHotkeyBehaviour
Rectangle SelectMDrag from one corner to the opposite. The simplest case.
Magic WandWClick a pixel to select pixels matching its colour. Two modes (see below).
LassoQDrag a freehand polygon. The selection rasterises on release using even-odd rule.
Selection BrushAPaint the selection mask with the active brush size/shape.

Four selection tools producing the same coverage

Magic Wand modes ​

Set in Tools panel → Magic Wand options when the tool is active:

  • Connected region — flood-fill from the click point. Selects only pixels reachable from the click via 4-connectivity.
  • All matching pixels — selects every pixel in the active layer matching the colour, regardless of connectivity.

A Tolerance slider (0–64) adds per-channel ±tolerance to the colour match — useful when you have anti-aliased edges or near-duplicate shades.

Selection Brush — A ​

A dedicated brush that paints directly into the selection mask — same mental model as the Pencil, but the strokes write into a binary mask instead of pixel colours. Uses your current brush Size and Shape settings.

A single toggle, Constrain to opaque pixels (default on), lives in the Tools panel when the brush is active:

  • On — the brush only enrols pixels where the underlying layer has alpha > 0. Painting over the head of a stick figure picks up only the drawn pixels and skips the transparent background.
  • Off — every cell the brush touches is enrolled, regardless of layer content.

Modifiers behave the same as the other selection tools: Shift adds to the existing selection, Alt subtracts. The marching-ants overlay grows live with the stroke, so you can see the silhouette form before you release.


Modifier keys (during drag) ​

While dragging with Select, Lasso, Magic Wand, or Selection Brush, hold modifiers to compose with the existing selection:

ModifierEffect
(none)Replace — discard previous selection
ShiftAdd — union of previous and new
AltSubtract — remove the new from the previous
Shift+AltIntersect — keep only the overlap (rect/lasso/wand only — the brush uses Shift / Alt only)

The combination is a true boolean operation on the masks — works with mixed shapes (e.g. lasso + rect = composite shape).


Selection actions ​

Move / floating selection ​

Drag inside an existing selection with any selection tool (Rect, Lasso, Magic Wand) to lift the pixels into a "floating selection" that follows the cursor. Without modifiers, the gesture always means "move"; holding Shift / Alt routes to the boolean-combine path instead, so the keyboard grammar stays consistent. While floating:

  • Arrow keys move it 1 px (Shift+Arrow = 8 px)
  • Click outside, or pick another tool, to commit it back into the layer.
  • Ctrl+X cuts; Ctrl+C copies; Ctrl+V pastes (the paste appears as a new floating selection).
  • Press Shift+T to enter Free Transform with on-canvas handles for live rotate/scale.

Clipboard ​

KeyAction
Ctrl+CCopy pixels under the selection (mask-aware — preserves silhouette).
Ctrl+XCut — like copy, but clears the underlying pixels.
Ctrl+VPaste — appears as a floating selection at the original position.
Delete / BackspaceClear pixels inside the selection without copying.

Select all / deselect / invert ​

KeyAction
Ctrl+AFull-canvas rectangle selection
Ctrl+DClear the selection
Ctrl+Shift+IInvert — flip the mask against the canvas, then trim the bounding box

Expand / Contract / Smooth / Border ​

When a selection is active, the Tools panel shows a Selection section with these operations:

  • Expand 1px — 4-neighbour dilate. The mask grows outward by 1 cell.
  • Contract 1px — 4-neighbour erode.
  • Smooth — morphological open + close (erode→dilate then dilate→erode). Removes 1-px spurs and fills 1-px holes; useful after a noisy Magic Wand pick or freehand Lasso.
  • Border… — opens a dialog that replaces the selection with an N-pixel band along its edge. Choose the band thickness and whether it sits Inside, Outside, or Centered on the original mask. Handy for outline-painting workflows that need to fill the band with a colour separately.

These all work on the mask (not the bounding rect), so a lasso selection grows / shrinks / smooths following its silhouette.


Outline / Stroke selection ​

Paint the contour of the selection on the active layer. Useful for creating outlines around shapes you've already drawn or selected.

  1. Make any selection.
  2. Tools panel → Stroke selection button (appears when a non-floating selection is active).
  3. Configure in the dialog:
    • Colour — Primary, Secondary, or custom hex
    • Thickness — 1 to 16 px (uses dilate/erode for >1 px)
    • Position — Inside / Outside / Center
  4. Click Stroke. One undo entry.

The outline follows the actual mask edges — for a lasso/wand selection, you get a contour that matches the silhouette, not a rectangle.

Stroke selection on a lasso shape, 2 px outside


Mask-aware overlay ​

The selection outline you see on canvas (the marching-ants-style dashed line) draws only on cell edges between selected and unselected pixels — so it visually matches the actual mask, not the bounding rect. While dragging a lasso, the overlay renders the live polygon points so you see exactly what will be selected.


Tips ​

  • A selection persists across tool changes, frame changes, and zoom — until you explicitly clear it (Ctrl+D) or replace it.
  • Selections do not persist across save/reload — they're per-session.
  • To capture a selection as a custom brush, use Tools panel → Brush → Custom brushes → + Capture.
  • Use Ctrl+Shift+I to invert when it's easier to select what you don't want first.

Motestack is a personal hobby project. The editor and these docs ship under no warranty — back up your `.mstack` files.