vectorize
Skill18 starsChanged 7 months agoMITView on GitHub
Convert a raster image to SVG. Three paths — Recraft hosted vectorization, vtracer (multi-color polygon), potrace (1-bit). Optimizes with SVGO; validates path count as a quality signal.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- danielrosehill/Claude-Image-Production-Plugintheir own version, first seen Nov 13, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- danielrosehill/Claude-Image-Production-Plugin★ 23same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/prompt-enhancer.mdcCursor rule
- .cursor/rules/prompt-to-asset.mdcCursor rule
- app-iconSkill
- asset-enhancerSkill
- asset-validation-debugSkill
- brand-consistencySkill
- faviconSkill
- illustrationSkill
- logoSkill
- og-imageSkill
- svg-authoringSkill
- t2i-prompt-dialectSkill
- transparent-bgSkill
- ui-mockup-promptSkill
- app-iconSkill
- asset-enhancerSkill
- asset-validation-debugSkill
- brand-consistencySkill
- faviconSkill
- illustrationSkill
- logoSkill
- og-imageSkill
- svg-authoringSkill
- t2i-prompt-dialectSkill
- transparent-bgSkill
- ui-mockup-promptSkill
- vectorizeSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 61
After vectorization, count <path> elements:
- Very specific: line 84
Never enable convertPathData with default floatPrecision — it collapses small strokes.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Vectorize
Three paths
1. Recraft /vectorize (hosted, highest quality)
Input: any raster. Output: clean SVG, typically 20–100 paths for a mark, 200–500 for an illustration. Commercial tier only.
const svg = await recraft.vectorize({ image: pngBuffer });2. vtracer (local, multi-color polygon)
- Rust binary;
npm install vtracerfor the Node wrapper. - Modes:
polygon(recommended for logos),spline(smoother curves),pixel(blocky). - Color count controlled upstream via K-means quantization before vectorization.
pipeline:
raster 1024²
→ BiRefNet matte (alpha the background)
→ K-means LAB 6-color palette
→ vtracer --mode polygon --filter-speckle 4 --color-precision 6
→ SVGO (conservative preset)3. potrace (local, 1-bit)
- Classical Stan Ford vectorizer; binary output only (no color).
- Best for: icon packs (single-color), typography work, line art.
- Multi-color workaround: separate each color into its own 1-bit layer, vectorize each, stack SVG
<g>s.
pipeline:
raster 1024²
→ BiRefNet matte
→ per-color mask (binary threshold per palette entry)
→ potrace per mask → <g> wrapper
→ combine into single SVG
→ SVGOChoosing the path
| Use case | Path |
| Budget available, one-shot quality | Recraft vectorize |
| Multi-color logo, local | vtracer (polygon mode) |
| Single-color icon pack | potrace |
| Photorealistic illustration → vector | don't — keep as PNG/WebP. Vectorization of photoreal is lossy noise. |
Path-count quality signal
After vectorization, count <path> elements:
- ≤40 paths → clean, production-ready mark.
- 40–200 paths → likely acceptable; scan for overlapping slivers.
- >200 paths → probably bad. Either the input has noise (regenerate), too many colors (reduce K-means), or the subject is inappropriate for vectorization (keep as raster).
SVGO configuration
Conservative preset — preserve: viewBox, IDs, classes. Strip: metadata, editor comments, hidden elements.
{
multipass: true,
plugins: [
{ name: 'preset-default', params: {
overrides: { removeViewBox: false, cleanupIds: { minify: false } } } },
'removeDimensions', // prefer viewBox-only
'sortAttrs',
'removeScriptElement' // security
]
}Never enable convertPathData with default floatPrecision — it collapses small strokes.
Validation
- SVG parses with
@resvg/resvg-jswithout errors. <path>count ≤ 200 for logos, ≤ 500 for illustrations.- No
<image>tags (sneaking raster into SVG). - No
<script>tags. - viewBox present.
- Rasterized at 1024 × 1024 should be visually identical (SSIM > 0.95) to source raster.
Output
vector/
├── mark.svg # primary vectorization
├── mark.svg.orig # pre-SVGO original (for debugging)
└── meta.json # paths_count, colors_used, svgo_savings_bytesDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

