A Python tool (CLI + GUI) that converts raster images to SVG using selectable styles.
Go to file
Diane Blackwood 7c058f5cfd Initial source code. 2026-01-02 18:49:21 -05:00
src Initial source code. 2026-01-02 18:49:21 -05:00
.gitignore Initial commit 2025-12-29 22:58:04 -05:00
LICENSE Initial commit 2025-12-29 22:58:04 -05:00
README.md Update 2025-12-31 09:45:28 -05:00
pyproject.toml Initial source code. 2026-01-02 18:49:21 -05:00

README.md

Raster2SVG Studio

A Python tool (CLI + GUI) that converts raster images to SVG using selectable styles. Initial styles:

  • Posterized (flat color regions)
  • Line-art (binary edge/ink look)

Requirements

  • Python 3.10+
  • Qt: PySide6
  • OpenCV: opencv-python
  • NumPy
  • svgwrite Optional (for best SVG preview quality in GUI):
  • cairosvg

Install (editable)

cd raster2svg-studio
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e .

CLI usage

r2s convert --in input.jpg --out out.svg --style posterized --params '{"n_colors":6,"min_area":80,"simplify":1.2}'
r2s convert --in input.jpg --out out.svg --style lineart --params '{"mode":"adaptive","block_size":31,"c":7,"min_area":40,"simplify":1.0}'

GUI usage

r2s gui

Notes

  • SVG preview in the GUI is rendered by converting SVG -> PNG in memory. If cairosvg is not installed, the preview falls back to showing the processed raster stage.
  • This scaffold is designed to add a "woodcut" style next (edges + hatching).