Mask Editor
The mask editor lets you create and refine masks that define which pixels belong to each trait. Clean masks are essential for quality layer extraction.
Editor Layout
The mask editor appears on the Detection page:
- Canvas - Shows base image with mask overlay (red tint)
- Toolbar (left) - Drawing tools and settings
- Thumbnail stack (right) - Switch between mask variants
- Navigation (top) - Move between all masks
Tools
Pan Tool (P)
Move around the canvas without affecting the mask.
- Click and drag to pan
- Use scroll wheel to zoom
- Double-click to reset view
- Hold Space to temporarily pan while using any other tool
Brush Tool (B)
Add to the mask (paint white pixels).
- Click and drag to paint
- Shift + drag for straight lines
- Scroll wheel to resize brush
Eraser Tool (E)
Remove from the mask (paint black pixels).
- Same controls as brush
- Removes areas from the mask
Rectangle Tool
Draw rectangular shapes on the mask.
- Click and drag to draw a rectangle
- Shape stays editable — click to select, drag to move, use handles to resize
Circle Tool
Draw circular/ellipse shapes on the mask.
- Click and drag to draw an ellipse
- Same selection and editing controls as rectangles
Polygon Tool
Draw free-form polygon shapes by placing vertices.
- Click to place each vertex
- Close the shape by clicking near the first point or double-clicking
- Undo the last vertex with Cmd/Ctrl+Z while drawing
Brush Settings
Size
Adjust brush size:
- Use the size slider in the toolbar
- Scroll wheel while hovering on canvas
- Range: 1px to 200px
Mode
Toggle between:
- Positive - Normal mode (brush adds, eraser removes)
- Negative - Inverted mode (brush removes, eraser adds)
Negative mode is useful for quickly removing large areas.
Mask Visualization
The mask is shown as a red overlay:
- Red areas - Part of the mask (will be extracted)
- Clear areas - Not part of the mask
The opacity of the overlay can be adjusted in settings.
Editing Workflow
Starting Fresh
- Click Clear to reset the mask
- Use the brush to paint the trait area
- Zoom in and refine edges
Refining AI Detection
- Run AI detection first
- Zoom in on problem areas
- Use eraser to remove excess
- Use brush to add missing areas
Precision Editing
- Zoom in close (scroll wheel)
- Use small brush size
- Follow edges carefully
- Toggle between brush and eraser
Persistent Shapes
Rectangle, Circle, and Polygon shapes are persistent vector objects — they stay editable after creation and are saved to the database:
- Survive page navigation — switch tabs and return, shapes are intact
- Survive sessions — close the browser and reopen, shapes are restored
- Auto-save — shapes save automatically after creation, move, resize, or deletion
- Positive/Negative modes — shapes can add to or subtract from the mask, just like brush strokes
Click any shape to select it (blue outline), then drag to reposition or use corner handles to resize. Press Delete or Backspace to remove the selected shape.
Keyboard Shortcuts
| Key | Action |
|---|---|
| P | Pan tool |
| B | Brush tool |
| E | Eraser tool |
| Shift + drag | Straight line |
| Scroll | Zoom in/out |
| Space (hold) | Temporary pan mode |
| Cmd/Ctrl + Z | Undo |
| Cmd/Ctrl + Shift + Z | Redo |
| Cmd/Ctrl + Y | Redo (alternative) |
| Cmd/Ctrl + = | Zoom in |
| Cmd/Ctrl + - | Zoom out |
| Cmd/Ctrl + 0 | Reset zoom |
| Delete / Backspace | Delete selected shape |
| Escape | Cancel polygon / deselect shape / switch to pan |
Mask Variants
Each trait supports up to 5 mask variants:
- v1-v5 - Different versions of the mask
- Star icon - Marks the favorite (used for extraction)
- + button - Add a new empty variant
Use variants to:
- Try different AI detections
- Create manual alternatives
- Keep backups before major edits
Auto-Save
Masks save automatically:
- After you stop drawing (short delay)
- When switching to another mask
- When leaving the page
No manual save button needed.
Tips for Clean Masks
Edge Quality
- Zoom in to 200%+ for edge work
- Follow the actual edge of the trait
- Clean edges = clean extracted layers
Coverage
- Include all pixels of the trait
- Don't include pixels from other areas
- Check corners and details
Common Mistakes
| Mistake | Effect | Fix |
|---|---|---|
| Jagged edges | Rough layer edges | Zoom in, smooth edges |
| Missing areas | Holes in extracted layer | Add with brush |
| Extra areas | Artifacts in layer | Remove with eraser |
| Overlapping traits | Wrong pixels in layer | Check each trait separately |
Testing Your Mask
After editing:
- Go to Variations page
- Generate a quick variation
- Check the extracted layer
- Return to Detection if needed
Troubleshooting
Mask won't paint
- Check you're using Brush tool (B)
- Check you're on the Detection page
- Make sure a trait is selected
Edges are too rough
- Zoom in closer
- Use smaller brush size
- Take your time on edges
AI detection missed areas
- AI isn't perfect
- Use brush to add missing areas
- Consider rewriting the detection prompt
Mask looks correct but layer is wrong
- Make sure the correct variant is favorited
- Check layer order isn't hiding anything
- Regenerate the layer