EdgeSVG — Production Raster-to-SVG Vectorization. Scored. Open Source.
One Command. Vectorize Anything.
pip install edgesvg — and your pipeline can convert any raster image to a production-quality SVG in milliseconds. No ML warmup, no GPU, no model downloads.
import edgesvg
# Vectorize with auto mode — EdgeSVG picks the best strategy
result = edgesvg.vectorize("logo.png", method="auto")
# Inspect quality metrics
print(f"SSIM: {result['report']['metrics']['ssim']:.4f}")
print(f"Edge F1: {result['report']['metrics']['edge_f1']:.4f}")
print(f"Path count: {result['report']['metrics']['path_count']}")
# Save SVG
with open("logo.svg", "w") as f:
f.write(result["svg"])
# Analyze the image before converting
info = edgesvg.inspect("logo.png")
print(info["recommendation"])
# Compare an existing SVG against the source
metrics = edgesvg.compare("logo.png", result["svg"])
print(f"Fidelity: {metrics['fidelity_score']:.4f}")import { vectorize, analyze, compare } from 'edgesvg';
import { writeFileSync } from 'fs';
// Vectorize with auto mode
const result = vectorize('logo.png', { method: 'auto' });
console.log('SSIM:', result.report.metrics.ssim.toFixed(4));
console.log('Edge F1:', result.report.metrics.edge_f1.toFixed(4));
console.log('Paths:', result.report.metrics.path_count);
// Save SVG
writeFileSync('logo.svg', result.svg);
// Analyze the image
const analysis = analyze('logo.png');
console.log('Image type:', analysis.analysis.kind);
// Compare SVG quality
const metrics = compare('logo.png', result.svg);
console.log('Fidelity:', metrics.fidelity_score.toFixed(4));# Install from source
cargo install --path .
# Auto mode — EdgeSVG chooses the best strategy
edgesvg convert logo.png logo.svg --method auto --json
# Premium high-fidelity conversion
edgesvg premium illustration.png illustration.svg --target 0.98 --json
# Inspect an image before converting
edgesvg info logo.png --json
# Compare SVG quality against source
edgesvg compare logo.png logo.svg --json
# Batch benchmark a directory of raster images
edgesvg benchmark \
--input-dir images/ \
--output-dir results/ \
--json-path results/report.json \
--markdown-path results/report.mduse std::path::Path;
use edgesvg::{vectorize_path, VectorizeMethod, VectorizeRequest};
let result = vectorize_path(
Path::new("logo.png"),
&VectorizeRequest {
method: VectorizeMethod::Auto,
target_ssim: 0.998,
..VectorizeRequest::default()
},
)?;
println!("SSIM: {:.4}", result.report.metrics.ssim);
println!("Edge F1: {:.4}", result.report.metrics.edge_f1);
println!("Method used: {:?}", result.effective_method);
println!("Decision: {}", result.decision);
// Write SVG to file
std::fs::write("logo.svg", &result.svg)?;import init, { vectorize, analyze, compare } from './pkg/edgesvg_wasm.js';
// Load WASM binary once
await init();
// Get file bytes from user upload
const file = document.querySelector('input[type=file]').files[0];
const bytes = new Uint8Array(await file.arrayBuffer());
// Vectorize — runs entirely in the browser
const result = vectorize(bytes, { method: 'auto' });
console.log('SVG length:', result.svg.length);
console.log('SSIM:', result.report.metrics.ssim.toFixed(4));
// Display result
const img = document.querySelector('#output');
img.src = 'data:image/svg+xml,' + encodeURIComponent(result.svg);
// Try it: /demo/Every SVG Output Is Scored. Not Just Generated.
EdgeSVG is the only open-source vectorizer that measures what it produces — so you can set quality gates, run regression tests, and compare methods objectively.
15+ Quality Metrics
SSIM, perceptual SSIM, edge similarity, edge F1, foreground IoU, color similarity, topology score, PSNR, MAE, delta-E, file size, and path counts — every run scored automatically.
Smart Auto Mode
Analyzes the image before tracing — classifies as logo, icon, illustration, or photo — then picks the best preprocessing and tracing strategy automatically.
Iterative Smart Search
The `smart` mode runs an iterative quality search, trying multiple strategies until it hits your SSIM and file-size targets or exhausts the budget.
Multiple Tracing Modes
convert, logo, premium, auto, smart, optimal — each tuned for different image types and quality requirements. One binary, multiple strategies.
WebAssembly: Browser Native
Full Rust engine compiled to WASM. Vectorize images in the browser with no server, no uploads. Privacy by design — image data never leaves the device.
5 SDK Languages
Native bindings for Python (PyO3), Node.js (NAPI-RS), Rust, CLI binary, and WebAssembly. Pre-built packages — no compilation needed for Python and Node.js.
11 CLI Commands
convert, logo, premium, auto, smart, info, analyze, compare, render, optimize, benchmark. Complete pipeline from analysis to batch processing.
Zero ML Dependencies
No GPU, no ONNX, no Python ML runtime. Pure Rust — deterministic, fast, and deployable anywhere: Lambda, containers, edge functions, browsers.
Stable SDK Contract
All SDKs return the same VectorizeResponse with svg, report, requested_method, effective_method, fallback_from, and decision — consistent across all runtimes.
Measure Vectorization Quality — Objectively
EdgeSVG computes a full quality report on every output so you don't have to guess. Set SSIM thresholds in CI, compare tracing strategies, and detect regressions automatically.
Output Quality Metrics
Every vectorization run scores the SVG output against the source raster. Here are the metrics EdgeSVG computes:
ssim Structural Similarity Index — perceptual quality vs. source raster ssim_perceptual SSIM computed on perceptually uniform color space edge_similarity How closely SVG edges match detected raster edges edge_precision Precision of edge reconstruction edge_recall Recall of edge reconstruction edge_f1 F1 score combining edge precision and recall foreground_iou Intersection over Union for foreground coverage color_similarity Color palette fidelity between SVG and source fidelity_score Composite weighted fidelity score delta_e Perceptual color difference (CIE 2000) topology_score Shape count and structural complexity score psnr Peak Signal-to-Noise Ratio in dB mae Mean Absolute Error between rasterized SVG and source file_size SVG file size in bytes path_count Raw <path> element count in generated SVG weighted_path_count Primitive-aware structural complexity (editability metric) Built for Real Automation Workflows
Teams building design pipelines, asset automation, and web applications choose EdgeSVG for its scored output, consistent SDKs, and zero-dependency deployment.
Logo & Icon Vectorization
Convert brand assets, icons, and UI elements into clean scalable SVGs. The logo mode produces minimal paths with clean curves — optimized for editability.
Learn more →Build Pipeline Integration
Run EdgeSVG in CI/CD to automatically vectorize raster assets at build time. JSON output with quality metrics lets you gate on SSIM thresholds.
Learn more →In-Browser SVG Conversion
The WebAssembly SDK brings the full Rust engine to the browser. No server required — users upload a PNG and get SVG output with quality scores instantly.
Learn more →Batch Asset Processing
Vectorize entire directories of raster images with the benchmark command. JSON and Markdown reports show per-image quality scores and aggregated summaries.
Learn more →Design Export Workflows
Integrate EdgeSVG into design-to-code pipelines to automatically produce SVG assets from exported PNGs. Scored output means you catch quality regressions early.
Multi-language Pipelines
Mix Python, Node.js, and Rust in the same pipeline — the SDK contract is identical across all runtimes. The same VectorizeRequest produces the same result everywhere.
Start Converting Raster to SVG in Under a Minute
pip install edgesvg and your first scored vectorization runs in seconds. No GPU. No ML models. No infrastructure.