image-to-svg

Solid

Convert raster images (photos, paintings, illustrations, line art) into SVG vector reproductions. Use when the user uploads an image and asks to reproduce, vectorize, trace, or convert it to SVG. Also use when asked to decompose an image into shapes, create an SVG version of a picture, or faithfully reproduce artwork as vector graphics. Handles graphic/line-art inputs (Kandinsky, architectural drawings, ink work) via a compositional pipeline that extracts lines as SVG strokes. Do NOT use for creating original SVG illustrations from text descriptions — only for converting existing raster images.

Data & Documents 134 stars 7 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 84/100

Stars 20%
71
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Image to SVG Reproduction Convert raster images into faithful SVG reproductions using data-driven color quantization and contour extraction. **Never hand-draw shapes from visual interpretation** — always extract geometry from the actual pixel data. ## Core Principle **Trust the data, not your imagination.** Claude's visual interpretation of images is unreliable for precise color matching, shape positioning, and spatial relationships. Every shape, color, and position must come from computational analysis of the source pixels. ## Quick Start ```bash pip install opencv-python-headless scikit-image scipy scikit-learn --break-system-packages -q apt-get install -y librsvg2-bin -qq ``` ```python import sys sys.path.insert(0, '/mnt/skills/user/image-to-svg/scripts') from pipeline import image_to_svg svg, flow = image_to_svg("source.jpg", mode="painting") with open("output.svg", "w") as f: f.write(svg) flow.summary() # timing + status per step ``` ## Mode Selection **Look at the image** and ask: "Does this have smooth gradients or hard edges?" Gradients → higher K. Hard edges → lower K. | Mode | K | Best for | Dark shape gating | |------|---|----------|-------------------| | `"graphic"` | 28 | Logos, icons, Kandinsky, flat design | Loose (keeps thin lines) | | `"illustration"` | 40 | Comics, editorial, digital art | Moderate | | `"painting"` | 56 | Renaissance, Impressionist, watercolor | Standard | | `"photo"` | 64 | Portraits, landscapes, still life | Standard (p...

Details

Author
oaustegard
Repository
oaustegard/claude-skills
Created
9 months ago
Last Updated
yesterday
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category