Documentation

Rustorizer turns images into clean, editable SVG files. It runs from the terminal, in your browser, or as an HTTP API, and the same input with the same settings always gives the same output.

Input: PNG, JPEG, WebP, BMP, GIF · Output: SVG

Install

Beginner install

No Rust yet? No problem. This one command installs Rust if needed, builds the project, installs the rustorizer command, and adds it to your PATH.

git clone https://github.com/dqev/rustorizer.git
cd rustorizer
./install.sh

Open a new terminal when it finishes, then start the app:

rustorizer ui

Advanced setup

You need Rust and Cargo. The setup script builds the project, installs the rustorizer command into ~/.cargo/bin, and adds that directory to your shell profile if it isn't there already.

./setup.sh

Restart your terminal, or reload your profile, so rustorizer is on your PATH.

source ~/.zshrc   # zsh
source ~/.bashrc  # bash

If you still see rustorizer: command not found, run ~/.cargo/bin/rustorizer directly, or add export PATH="$HOME/.cargo/bin:$PATH" to your shell profile.

Then convert your first image, replacing logo.png with your file. The result is saved as logo.svg next to the input.

rustorizer logo.png

Setup options

Command What it does
./install.sh Simple install: Rust, build, install, PATH
./setup.sh Build and install
./setup.sh --test Run all tests and benchmarks
./setup.sh --ui Build, install, and start the web app at 127.0.0.1:8080
./setup.sh --no-install Build only
./setup.sh --no-path Install without editing your shell profile

If you use --no-install, run ./target/release/rustorizer instead of rustorizer.

Command line

Convert to the default name, or pass an explicit output path:

rustorizer logo.png              # saves logo.svg
rustorizer logo.png clean.svg    # saves clean.svg

Other options

Task Command
Remove the background rustorizer sprite.png --remove-background
Use the no-overlap algorithm rustorizer icon.png --algorithm no-overlap
Debug with X-ray mode rustorizer shape.png --debug-xray

Presets

Pick the preset that matches your image for the best result.

Preset Command
Clipart rustorizer icon.png --preset clipart
Gradient rustorizer icon.png --preset gradient
Photo rustorizer photo.jpg --preset photo
Line art rustorizer sketch.png --preset line

Browser app

Start the local web server:

rustorizer ui

Then open the website or the Studio workbench.

Self-hosting

With Docker

Run this inside the cloned rustorizer folder, then open http://localhost:8080.

docker compose up -d --build

To use a different port, such as 3000:

RUSTORIZER_PORT=3000 docker compose up -d

Without Docker

Build and run the API server, or use the installed command line tool:

cargo build --release --workspace
VECTOR_API_BIND=0.0.0.0:8080 ./target/release/vector-api

# or
rustorizer ui --host 0.0.0.0 --port 8080

vector-api chooses its address in this order: VECTOR_API_BIND, then PORT on 0.0.0.0, then 127.0.0.1:8080.

Custom domain

Example Caddyfile for Caddy as a reverse proxy:

vector.yourdomain.com {
    reverse_proxy 127.0.0.1:8080
}

HTTP API

Method Route Purpose
GET / Website
GET /studio Browser app
GET /health Health check
POST /v1/vectorize Convert an uploaded file
POST /v1/vectorize/json Convert a base64 image
POST /v1/palettes Get color palette suggestions

The upload and JSON body limit is 20 MB. CORS is enabled.

Health check

curl http://127.0.0.1:8080/health
{"status":"ok","version":"0.1.0"}

Convert a file

Send multipart/form-data with a file field. The options field (JSON) is optional.

curl http://127.0.0.1:8080/v1/vectorize \
  -F "file=@logo.png" \
  -F 'options={"algorithm":"overlap","format":"svg"}'

Convert a base64 image

POST /v1/vectorize/json

{
  "image_base64": "<base64 or data URI>",
  "options": {
    "algorithm": "overlap",
    "format": "svg"
  }
}

Get color palettes

POST /v1/palettes

{
  "image_base64": "<base64 or data URI>",
  "counts": [4, 8, 12]
}

How it works

Project layout

rustorizer/
  engine/          Core library (vector-core)
    src/pipeline/  Color reduction, denoising, preprocessing, config
    src/geometry/  Topology, smoothing, curve and circle fitting, centerlines
    src/render/    Layers, gradient meshes, SVG output
    tests/         Integration and benchmark tests
  services/
    api/           HTTP API (vector-api, built with Axum)
    cli/           Command line and benchmark tool
  web/             Website and Studio (no build step)
  docs/            Architecture notes

Rustorizer · MIT License · Changelog

Built by Dev Chauhan