Draw & erase
The brush (`B`) and eraser (`E`) — free-paint strokes with size, opacity, and softness, plus a global erase mask that punches transparency through draw layers.
The draw tool gives you a freehand brush and a matching eraser. Strokes accumulate on a single document-wide draw layer rather than creating a new layer per stroke — that keeps the layers panel clean and lets the eraser punch through past strokes naturally.
#Brush — B
| Setting | What it does |
|---|---|
| Color | Stroke color. Click the swatch to open the color picker; alpha supported. |
| Size | Brush diameter in px. Range 1–500. |
| Opacity | Per-stroke opacity, 0–100%. |
| Softness | Edge falloff, 0–100%. 0 = hard edge, 100 = fully feathered. |
| Mode | paint (color) or blur (blur whatever is beneath the stroke). |
Brush strokes are smoothed via a midpoint algorithm — the renderer draws a quadratic curve through each move event, so strokes stay gap-free at any pointer speed.
#Eraser — E
The eraser is a separate sibling tool with its own size and softness. It punches transparency through both the draw layer and erase mask, so erased areas show whatever is underneath in the layer stack.
| Setting | What it does |
|---|---|
| Size | Eraser diameter in px. |
| Softness | Edge falloff. |
#How draw / erase compose under the hood
Two off-screen canvases per document:
drawCanvas— additive paint (compositedsource-over)eraseCanvas— destructive mask (compositeddestination-out)
A pair of flags (hasDrawing, hasErasing) gates whether each canvas participates in the composite. Until the user has actually erased something, the erase canvas is skipped — so loading a fresh project doesn't paint a phantom mask.
This is why the eraser feels "real" — it doesn't just paint white pixels, it removes alpha. Saving and re-opening preserves the erase mask perfectly via the erase-mask resource entry in the .img package.
#Tips
- For a soft watercolor feel, set softness 60+ and opacity 25%. Layer multiple passes.
- For pixel-perfect lineart, softness 0, opacity 100, size ≤ 6 px.
- Blur mode is a fast way to selectively de-emphasize part of a photo — paint over a face, license plate, or background.
- The eraser does not affect shape, text, icon, or asset layers — those are vector-style layers with their own visibility / transform. Use layer effects or layer masks (planned) for non-destructive cuts on those.