Pipeline
The engine produces real vector paths — never an embedded bitmap. Auto mode analyzes the image and chooses the whole strategy.
- Analysis: infers the true design palette, classifies the artwork (flat logo, flat illustration, gradient illustration, complex artwork, photograph), and computes a vector-suitability score that stops photographs before an expensive trace.
- Palette snapping: collapses anti-aliased edges into the true design colors so the tracer sees clean region boundaries.
- Background removal: topology-aware — background is a spatial region, not a color. Exterior canvas is removed, enclosed holes/counters become transparent, intentional background-colored artwork is preserved, and interrupted silhouettes are completed by strict-confidence geometric fitting.
- Tracing + refit: a dense boundary trace (imagetracerjs) feeds a geometry stage that detects corners and fits smooth Bézier curves along the real boundaries.
- Region overrides: a deterministic manual-correction layer (used by the app's region editor) that can remove or restore individual regions without disturbing nested artwork.
Where it runs
Shaw Image Vector runs the engine locally in the browser inside a Web Worker — images are never uploaded. The asset pipeline runs the same engine in Node to turn the brand's raster logos into production SVG.
Regression suites
The engine ships deterministic Node test suites covering pixel fidelity, background-removal semantics, contour completion, nested topology, manual corrections, and the photograph gate — run against both synthetic fixtures and real logos.
cd packages/engines/vector-processing
bash tests/run.sh