plugins/prompt-to-asset/skills/vectorize/SKILL.md
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.
npx skillsauth add MohamedAbdallah-14/prompt-to-asset vectorizeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
/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 });
vtracer (local, multi-color polygon)npm install vtracer for the Node wrapper.polygon (recommended for logos), spline (smoother curves), pixel (blocky).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)
potrace (local, 1-bit)<g>s.pipeline:
raster 1024²
→ BiRefNet matte
→ per-color mask (binary threshold per palette entry)
→ potrace per mask → <g> wrapper
→ combine into single SVG
→ SVGO
| 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. |
After vectorization, count <path> elements:
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.
@resvg/resvg-js without errors.<path> count ≤ 200 for logos, ≤ 500 for illustrations.<image> tags (sneaking raster into SVG).<script> tags.vector/
├── mark.svg # primary vectorization
├── mark.svg.orig # pre-SVGO original (for debugging)
└── meta.json # paths_count, colors_used, svgo_savings_bytes
testing
Translate a UI brief (a page, a screen, a single component, a feature) into a paste-ready prompt for Nano Banana Pro / gpt-image-2 / Ideogram / Flux 2 / Midjourney that produces a designer-grade mockup as visual inspiration — not pixel-spec UI, not AI slop. Use whenever the user asks for "imagine the X page", "mock up the Y screen", "give me a prompt for nano banana / gpt image 2 to design", "describe this UI for an image model", "draft a prompt for the designer to take inspiration from", or any time the agent needs to produce a UI image-gen prompt for a real product surface (pricing page, dashboard, settings, onboarding, mobile screen, marketing hero, single component). Be pushy — trigger even when the user says "design" without "prompt", or "show me what X could look like" — the agent should reach for this skill before hand-rolling a brief.
testing
Translate a UI brief (a page, a screen, a single component, a feature) into a paste-ready prompt for Nano Banana Pro / gpt-image-2 / Ideogram / Flux 2 / Midjourney that produces a designer-grade mockup as visual inspiration — not pixel-spec UI, not AI slop. Use whenever the user asks for "imagine the X page", "mock up the Y screen", "give me a prompt for nano banana / gpt image 2 to design", "describe this UI for an image model", "draft a prompt for the designer to take inspiration from", or any time the agent needs to produce a UI image-gen prompt for a real product surface (pricing page, dashboard, settings, onboarding, mobile screen, marketing hero, single component). Be pushy — trigger even when the user says "design" without "prompt", or "show me what X could look like" — the agent should reach for this skill before hand-rolling a brief.
development
Rewrite an asset brief into the exact prompt dialect of the target image model (OpenAI gpt-image-1, Google Imagen/Gemini, SDXL, Flux.1/Flux.2, Midjourney, Ideogram, Recraft). Handles negative-prompt translation, token budgets, transparency quirks, brand-palette injection, and text-in-image ceilings so that `asset_generate_*` submissions succeed on the first try.
development
Generate a production-grade logo (primary brand mark). Returns RGBA PNG master + SVG vector + monochrome variant. Route by text-length and per-model ceiling. Strong-text models render multi-word and even paragraph-length wordmarks reliably; weak-text models composite SVG type post-render.