raster-logo-svg
Turn a raster logo (PNG, JPG, WebP) into a pixel-identical, self-contained SVG by base64 embedding. Use when an .svg logo is needed without a vector source, or a redrawn SVG does not match the original.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 1.6k
- Forks
- 491
01 前言 Front Matter
- name
- raster-logo-svg
- description
- Turn a raster logo (PNG, JPG, WebP) into a pixel-identical, self-contained SVG by base64 embedding. Use when an .svg logo is needed without a vector source, or a redrawn SVG does not match the original.
02 资源文件 1
- 脚本scripts/embed-logo.py3.0 KB
03 SKILL.md 正文
raster-logo-svg
Create an SVG wrapper around an existing raster logo so the output is pixel-identical to the source. This is not true vectorization.
Choose the approach
| Need | Do |
|---|---|
| Match an existing raster logo exactly | Embed (this skill) |
| Crisp at any size, editable paths | Export from Figma/Illustrator, or commission true vector |
| Quick monochrome outline | Potrace (usually wrong for brand logos with color/gold/type) |
| Hand-redrawn paths | Only if no raster exists and user accepts approximation |
Default to embed when a .webp, .png, or .jpg logo already exists and the user wants .svg.
Workflow
- Source of truth — keep the raster (e.g.
docs/logo.webp). Do not delete it. - Generate SVG — run the script bundled with this skill (
scripts/embed-logo.py, relative to this SKILL.md; resolve it from wherever the skill is installed):
python3 <skill-dir>/scripts/embed-logo.py docs/logo.webp -o docs/logo.svg -l "project-name"
The script refuses to overwrite an existing output; pass --force to regenerate one.
Requires ImageMagick (magick identify) for dimensions. Install: brew install imagemagick.
- README — prefer the raster in GitHub README for reliable rendering:
<img src="docs/logo.webp" alt="project-name" width="580" />
Use the SVG for plugin manifests, favicons, npm package icons, or anywhere a .svg path is required.
- Verify — open the SVG locally; it must look identical to the raster. Do not commit temp traces (
icon-traced.svg, potrace output, failed hand-drawn attempts).
Output format
The script produces:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 W H" role="img" aria-label="…">
<image width="W" height="H" href="data:image/webp;base64,…"/>
</svg>
viewBoxmatches source pixel dimensions frommagick identify.- MIME:
image/webp,image/png, orimage/jpegfrom file extension. - Self-contained: no external
href="logo.webp"(breaks when SVG is copied alone).
Tradeoffs (tell the user when relevant)
- Pros: Perfect visual match, fast, no design source needed.
- Cons: Not true vector; upscaling very large may soften (same as the raster).
- Size: SVG file ≈ base64(raster) + ~200 bytes overhead (~33% larger than raw binary).
Do not
- Hand-draw paths to “recreate” a brand logo when the raster exists — results rarely match.
- Use potrace/ImageMagick trace for full-color wordmarks.
- Replace the canonical raster with only SVG unless the user explicitly drops the raster.
- Embed secrets or sensitive images in public repos without user confirmation.
Optional: external-reference SVG
Only for local tooling that resolves sibling files (not GitHub README <img src="logo.svg">):
<image href="logo.webp" width="1163" height="350"/>
Prefer base64 embed for portable .svg files.
Example (designer-skill)
python3 skills/raster-logo-svg/scripts/embed-logo.py \
docs/designer-skill-mcp-logo.webp \
-o docs/designer-skill-mcp-logo.svg \
-l "designer-skill-mcp" --force # run from this repo's root; the output already exists
README uses designer-skill-mcp-logo.webp; plugin/icon paths can use the .svg.
04 同仓库更多 Skills
worktable-review-with-annotations
Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.
worktable-find-and-synthesize-context
Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.
worktable-create-or-update-docs
Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.
worktable-create-or-manage-records
Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.
worktable-create-or-manage-interactive-html
Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.
worktable-collaborate-threads
Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.