Bitmap-to-vector reconstruction

Reveal the shape within.

Most vectorizers trace pixels. Morphēa reconstructs form, turning bitmap artwork into clean, editable SVG geometry.

Live quality artifacts

Bitmap and exported SVG, same canvas.

PASS

Touching circle and stroke

primitive_contact_pair
Bitmap
touching_circle_stroke_right bitmap
SVG
touching_circle_stroke_right SVG

2 anchors L1 0.0000 edge 0.0000

Stroke crossing rectangle

primitive_contact_pair
Bitmap
stroke_crossing_rectangle_horizontal bitmap
SVG
stroke_crossing_rectangle_horizontal SVG

2 anchors L1 0.0000 edge 0.0000

Pipeline

Geometry first. Learning and refinement where they help.

1

Read the bitmap

Normalize alpha, reduce palette drift, bound analysis size, and keep real images tractable.

2

Recover anchors

Find circles, strokes, rings, rectangles, quads, cut-outs, and regular grids before generic fitting.

3

Build the scene

Write layers, groups, reservations, metrics, and export policy metadata instead of opaque paths.

4

Inspect and improve

Use reports, curated checks, reviewed pseudo-labels, retraining, and structure-preserving refinement.

Current baseline

Designed for artwork that should stay editable.

Primitive anchors

Circles, dots, rings, strokes, arcs, rectangles, rounded rectangles, quads, and perspective grids.

Cut-out semantics

White interior gaps can stay selectable as overlay strokes or become SVG mask candidates.

Bounded local runs

Max size, palette quantization, component deferral, timeout diagnostics, and profile reports.

Research loop

Synthetic data, classifier training, curated checks, review queues, retraining gates, and refinement.

Primitive quality gate

Generated bitmap-to-SVG proof cases.

These panels are generated from passing primitive-check artifacts. Each bitmap and SVG pair uses the same fixed canvas.

Primitive quality gallery: 356 passing cases

Quickstart

Run the current baseline locally.

The legacy curve command remains as an alias, but new scripts should use morphea.

python -m pip install -e .
python -m unittest discover -s tests
morphea vectorize input.png -o output.svg --color-tolerance 18
morphea curated-check docs/real-images/suite.json -o runs/curated.json --run

Repository docs

The homepage is the front door. The docs hold the machinery.

Status

The baseline is implemented; optional adapters stay explicit.

Morphēa runs with a deterministic baseline today. Optional MLX SAM and DiffVG adapters report their configuration state instead of silently becoming requirements.