★ New · ANALYSIS

Click. Digitize. Done.

The fastest path from orthophoto to vector polygon. Click anywhere on a raster and VoltGrid's magic-wand tool traces the color-similar region into a clean vector boundary — building footprints, fields, vegetation patches, water bodies, substation pads. No training, no GPU, no model weights. Pure CIELAB delta-E flood fill on the host CPU, with Visvalingam-Whyatt simplification baked in. A faithful port of the popular Kanahiro/MagicWand QGIS plugin.

CIELAB delta-EUnion-find flood fill Gradient growVisvalingam-Whyatt simplify Multi-seedNo GPU · no model · no sidecar
How it works

Color science + graph flood fill

Not a deep-learning model. The magic wand converts each pixel to CIELAB color space, computes delta-E (Euclidean LAB distance) from the seed pixels, and runs a run-based union-find flood fill with 4-connectivity. A gradient-grow pass then walks smooth color gradients outward, and Visvalingam-Whyatt simplification removes pixel staircasing from the resulting polygon.

  • Slider 10–90 → tolerance 1.0–12.0 delta-E — geometric mapping gives you fine control at low tolerance and broad strokes at high.
  • Multi-seed — click several seeds; each pixel's delta-E is the minimum to any seed's patch median, so you can capture multi-tone regions in one pass.
  • Reference re-anchoring — one refinement pass re-fits the reference color to the region median (drift/coverage/convergence guards).
  • Off-mask seed snapping — clicks slightly outside the similar-color region snap to the nearest True pixel within radius 3.
  • Live preview — 150 ms debounced recompute as you adjust the slider; right-click to confirm.
POST /api/magicwand/select
// click on the rendered map → polygon
{
  "width":  1024,
  "height": 768,
  "extent": { xmin, ymin, xmax, ymax },
  "bgra":   "<base64 screenshot>",
  "seeds":  [{ x: 420, y: 312 }],
  "tolerance": 5.5
}

→ mask via union-find flood fill
→ polygonized + Visvalingam-Whyatt
→ returned in view CRS
Two capture modes

Rendered map or raw COG

🗺️

Rendered mode

Capture from whatever the map is currently showing — basemap, ImageServer export, your own tiles. The bridge calls view.takeScreenshot(), swaps RGBA→BGRA, base64-encodes, and POSTs the result + the view extent. Polygons come back in the view's CRS.

🖼️

Raw COG mode

Capture from a registered Cloud-Optimized GeoTIFF directly. The host reads three bands via RasterWindowReader, downscales if > 2,000,000 analysis pixels, per-band min-max stretches to 0–255, and polygonizes against the COG's native bbox. Higher fidelity than the rendered screenshot path.

In-App Screenshots

Magic Wand Widget & GeoPackage Persistence

VoltGrid desktop — Magic Wand analysis widget active over satellite raster
Magic Wand floating widget with live seed selection, tolerance slider, and real-time boundary preview over aerial raster
VoltGrid desktop — Magic Wand captured polygon saved to GeoPackage layer
Confirmed magic wand polygon saved directly to an offline GeoPackage layer with attribute schema and instant map rendering
VoltGrid desktop — Saved magic_wand.gpkg inspected in GeoPackage Manager
Saved magic_wand.gpkg inspected in GeoPackage Manager showing the MULTIPOLYGON selection table with 4 captured features
Utility use cases

Fast polygon capture from any raster

🏠

Building footprints

Trace structures from orthophotos — service drops, outbuildings, adjacent properties, before/after storm.

🌾

Vegetation patches

Capture canopy extent near a span to seed a NERC FAC-003 vegetation analysis.

💧

Water & flood extent

Digitize flood inundation from satellite or drone captures for storm-response mapping.

🏗️

Substation pads

Trace equipment pads, fence lines, and yard extents from substation orthophotos.

🚧

ROW clearing

Capture right-of-way boundaries from corridor imagery to anchor plan-profile sheets.

🌳

Land cover

Quick land-cover polygons without standing up a full supervised-classification workflow.

Pair with SAM2. Magic Wand is the right tool for fast, color-based capture from any imagery. For complex scenes (textured roofs, mixed pixels, occluded boundaries) reach for SAM2 segmentation instead — Meta's foundation model handles those cases zero-shot. The two tools complement each other; pick per scene.
Persistence

Captured polygons stick around

Confirm a magic-wand selection and it persists to <dataDir>/gpkg/magic_wand.gpkg — a valid GeoPackage alongside your structures, conductors, and bookmarks. Re-load, edit with the native Editor widget, or export to any format like any other layer.

EndpointVerbPurpose
/api/magicwand/selectPOSTStateless selection — render mask → polygons (no persistence).
/api/magicwand/savePOSTPersist a confirmed selection to magic_wand.gpkg.
/api/magicwand/selectionsGETList all saved selections.
/api/magicwand/selectionsDELETEClear all saved selections.

The Magic Wand algorithm performs CIELAB color space distance calculations, union-find flood fill, boundary polygonization, and Douglas-Peucker simplification in real time.

From click to polygon in milliseconds

No model download, no GPU, no Python sidecar. Just open the panel, click, and confirm.