Bitmap import & Trace
Glyph treats raster images as reference / tracing aids — they render on the canvas but are excluded from .gds export. Use them to import a photo, scan, or screenshot of an existing layout and trace it into real polygons.
Import a bitmap
Three equivalent ways:
- Drag-and-drop a
.png/.jpg/.webp/.bmp/.gifdirectly onto the Glyph window. A "Drop to open" overlay confirms the file is accepted. - File → Open… and pick an image file instead of a
.gds. - Programmatically via the Claude/MCP bridge (see §17).
The import dialog shows a thumbnail and asks for the µm per pixel scale (with 0.1 / 0.5 / 1 / 5 / 10 µm/px presets). Very large images are auto-downsampled to a sane maximum before import — the dialog says so when this happens.
The imported bitmap is placed centered on the current viewport on the active layer. Bitmaps select, move, rotate, scale, and mirror like any other shape; the Properties panel exposes umPerPx, rotation, and reflect. Bitmaps participate in snap / measure / hit-tests so they're a usable tracing target — they just don't survive a real .gds save.
Trace bitmap → polygons (Edit → Trace bitmap…)
Select a single bitmap, then Edit → Trace bitmap…. Four modes:
| Mode | What it produces |
|---|---|
| Cutoff | One band: pixels darker (or lighter, with Invert) than the threshold become filled polygons. Best for clean black-on-white art. |
| Steps | N gray bands (N = "Levels"). Each band is a closed contour at a luminance step. Use for posterized images or topo-style stack-ups. |
| Edges | Marching-squares contour on the image gradient. Good for line art where outlines matter more than fill. |
| Colors | Median-cut clustering into N color bands, each becoming a separate set of polygons. Use to recover a multi-layer mask from a colored reference. |
Shared knobs:
- Min area (px²) — speckle filter; islands below this are dropped.
- RDP tolerance (px) — Ramer–Douglas–Peucker simplification of the contour. Higher = fewer vertices = chunkier edges.
- Oversample — bilinear upsample (1× / 2× / 4×) of the gray buffer before binarising. Higher = smoother diagonals at quadratic cost. (Colors mode ignores this.)
- Snap to grid — round every output vertex to the current grid step.
- Per-band layers (Steps / Colors only) — when on, each band lands on its own auto-created layer. When off, all bands land on the active layer.
The dialog renders a live preview overlay so you can tune knobs before committing. Pressing Apply replaces nothing — the polygons are added to the active cell as a new selection, leaving the source bitmap in place so you can re-trace with different settings. Delete the bitmap manually when you're done.