← ClaudeAtlas

daftai-image-to-svglisted

Converts transparent or solid-background single-color PNG files and SVG files containing one embedded or local PNG into verified path-only SVG output. Removes pure-color backgrounds automatically. Uses Potrace threshold and parameter scans with alpha error metrics to preserve detailed logos, stamps, engravings, and line art. Use when the user asks to convert images to SVG, vectorize PNG, convert bitmap to true SVG, remove embedded raster data from SVG, 图片转矢量, PNG 转 SVG, 真矢量, or 位图描摹.
daftAI2026/daftAI-skills · ★ 2 · AI & Automation · score 59
Install: claude install-skill daftAI2026/daftAI-skills
# Image to SVG Convert transparent or solid-background single-color artwork into a genuine SVG containing paths rather than an embedded bitmap. Automatic tracing approximates the raster boundary. Only the original vector source can provide mathematically exact curves. ## Scope Supported: - Transparent PNG. - PNG on a pure-color background, including white, red, green, or other flat colors. - SVG containing exactly one Base64 or local PNG. - Single-color logos, stamps, engravings, silhouettes, and detailed line art. Reject: - Photos, gradients, textured backgrounds, and multicolor artwork. - Remote image URLs. - SVG mixing raster artwork with existing paths. - Centerline or editable-stroke reconstruction. For multicolor artwork, recommend VTracer instead of forcing this workflow. ## Script Directory **Important**: All scripts are located in the `scripts/` subdirectory of this skill. **Agent Execution Instructions**: 1. Determine this SKILL.md file's directory path as `SKILL_DIR`. 2. Set command working directory to `${SKILL_DIR}`. 3. Execute `bun ${SKILL_DIR}/scripts/vectorize.ts`. 4. Replace `${SKILL_DIR}` with the absolute path. | Script | Purpose | |---|---| | `scripts/vectorize.ts` | Extract alpha, scan Potrace candidates, measure error, and deliver the best path-only SVG | | `scripts/vectorize.test.ts` | Unit and real-toolchain regression tests | ## Dependencies Detect the runtime once per session: ```bash command -v bun command -v ffmpeg command -v ffprob