A minimal webapp that turns PNGs/JPGs/SVGs into centerline (skeleton) SVGs using a Python backend, with optional Perfect Circle (Fit) and Rect detection for clean geometric outputs.
For full functionality, you need the backend (local or hosted).
1.This will create a venv folder with all dependencies within it
cd /Users/amosjerbi/Desktop/tracer
python3 -m venv venv
source venv/bin/activate
pip install numpy pillow scikit-image opencv-python-headless svgwrite cairosvg skan
- Start the server
python3 server.py
- Open
http://localhost:8000/index.html
- Drag & drop PNG/JPG/SVG → auto‑generates centerline preview
- Adjustable white threshold, vector points, epsilon, curve smoothing, and stroke width
- Presets: Clean, Angular, Smooth, Bold, Perfect Circle (Fit)
- Toggle Add shapes behind lines for circle/rect fills where detected
- Overlay original image (opacity dropdown) and change preview stroke color
- Download SVG after generation
- Pan/zoom the preview (drag to pan,
+/-to zoom)
- Create a new Web Service on Render.
- Connect the repo:
https://github.com/amosjerbi/tracer - Set Build Command:
pip install -r requirements.txt
- Set Start Command:
python3 server.py
- Once deployed, copy your Render URL and set it in
app.js:
const API_BASE = "https://YOUR-RENDER-URL";
Commit + push, and GitHub Pages will now use the hosted backend.
- The browser sends a PNG to
server.py. - The server calls
centerline.pywith your slider values. - The SVG is returned and shown in the dropzone preview.
python3 centerline.py /path/to/image.png -preview 240 6 2 15 centerlineArgs:
-previewoutput suffix240white threshold (200–255)6epsilon2curve smoothing iterations15stroke widthcenterlineorcirclemode (circle mode fits circles/rects per component)