跳到主要内容
知仓学习社ZHICANG

raster-logo-svg

Wrap raster logos (webp, png, jpg) in self-contained SVG files via base64 embedding for pixel-perfect matches. Use when creating logo SVGs, converti…

执行命令严重 0 · 高危 1hashgraph-online/awesome-codex-plugins

它会碰到什么

扫了多少2 个文本文件,5 KB
它会碰到什么执行命令
命中总数1 处
命中统计严重 0 · 高 1 · 中 0 · 低 0
逐条看命中(1 条严重或高危)
  • scripts/embed-logo.py:22exec-spawn
    out = subprocess.run(

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

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

  1. Source of truth — keep the raster (e.g. docs/logo.webp). Do not delete it.
  2. Generate SVG — run the script from repo root or skill directory:
python3 skills/raster-logo-svg/scripts/embed-logo.py docs/logo.webp -o docs/logo.svg -l "project-name"

Requires ImageMagick (magick identify) for dimensions. Install: brew install imagemagick.

  1. 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.

  1. 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>
  • viewBox matches source pixel dimensions from magick identify.
  • MIME: image/webp, image/png, or image/jpeg from 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"

README uses designer-skill-mcp-logo.webp; plugin/icon paths can use the .svg.

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。