Skip to content

CLI Reference

The EdgeSVG CLI is a single binary that can be installed via Cargo.

Terminal window
cargo install edgesvg
edgesvg [OPTIONS] <COMMAND>
OptionShortDescription
--help-hPrint help
--version-VPrint version
--verbose-vVerbose output

Convert a single image to SVG.

Terminal window
edgesvg convert [OPTIONS] <INPUT> [OUTPUT]
ArgumentDescription
<INPUT>Path to input image (PNG, JPG, WebP, GIF)
[OUTPUT]Output SVG path (defaults to <INPUT>.svg)
OptionShortDefaultDescription
--method <METHOD>-mautoVectorization method: auto, logo, premium, smart, convert
--target-ssim <FLOAT>0.995Target SSIM for smart method
--max-file-size <BYTES>noneMax output file size
--json-jfalsePrint quality report as JSON
--verbose-vfalseVerbose output
Terminal window
# Basic conversion
edgesvg convert logo.png logo.svg
# Auto mode with JSON report
edgesvg convert input.png output.svg --method auto --json
# Target quality with smart mode
edgesvg convert input.png output.svg --method smart --target-ssim 0.998
# Premium mode, verbose
edgesvg convert illustration.png --method premium --verbose
{
"svg": "...",
"requested_method": "Auto",
"effective_method": "Logo",
"fallback_from": null,
"decision": "Image classified as logo (low unique colors, high edge density)",
"report": {
"score": 0.984,
"grade": "A",
"summary": "Excellent vectorization quality",
"metrics": {
"ssim": 0.9980,
"edge_f1": 0.9870,
"path_count": 4,
"file_size": 1842
}
}
}

Convert multiple images with glob patterns.

Terminal window
edgesvg batch [OPTIONS] <INPUT_GLOB> [OUTPUT_DIR]
OptionDefaultDescription
--methodautoVectorization method for all inputs
--jobsCPU countParallel worker threads
--jsonfalseWrite report.json to output dir
--target-ssim0.995Quality target for smart method
--continue-on-errorfalseSkip failing items instead of stopping
Terminal window
# Batch convert folder
edgesvg batch "assets/icons/*.png" assets/icons/svg/
# Parallel with 8 threads
edgesvg batch "logos/**/*.png" out/ --jobs 8
# Write report
edgesvg batch "*.png" svg/ --json

Run quality benchmarks against a set of golden images.

Terminal window
edgesvg benchmark [OPTIONS] <GOLDEN_DIR>
OptionDefaultDescription
--outputstdoutOutput path for results CSV/JSON
--formattabletable, json, csv
Terminal window
edgesvg benchmark golden_data/ --format json --output benchmark_results.json

Print quality metrics for an existing SVG against its source image.

Terminal window
edgesvg inspect <ORIGINAL_IMAGE> <SVG_FILE>
Terminal window
edgesvg inspect logo.png logo.svg
# SSIM: 0.9980 EdgeF1: 0.9870 Grade: A

Print the installed version.

Terminal window
edgesvg version
# edgesvg 0.1.0 (Rust 1.82, built 2025-01-01)

CodeMeaning
0Success
1Conversion failed
2Quality threshold not met (smart mode)
3Invalid arguments
4I/O error

VariableDescription
EDGESVG_LOGLogging level: error, warn, info, debug, trace
EDGESVG_JOBSOverride default parallelism for batch commands
EDGESVG_TARGET_SSIMOverride default SSIM target