← 返回 Skills 市场
lijy2015

SVG Draw

作者 LiJY2015 · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
3575
总下载
4
收藏
19
当前安装
1
版本数
在 OpenClaw 中安装
/install svg-draw
功能描述
Create SVG images and convert them to PNG without external graphics libraries. Use when you need to generate custom illustrations, avatars, or artwork (e.g., "draw a dragon", "create an avatar", "make a logo") or convert SVG files to PNG format. This skill works by writing SVG text directly (no PIL/ImageMagick required) and uses system rsvg-convert for PNG conversion.
使用说明 (SKILL.md)

SVG Draw

Generate vector graphics and raster images using pure SVG code and system conversion tools.

Quick Start

For new drawings:

  1. Write SVG code directly to a file (use templates in assets/ as starting points)
  2. Convert to PNG using the conversion script
  3. Send via the appropriate channel (DingTalk, Telegram, etc.)

For existing SVG files:

  1. Use the conversion script to convert SVG → PNG
  2. Share the resulting image

Creating SVG Images

Basic Workflow

  1. Choose or create a template

    • Check assets/ for existing templates (dragon, lobster, etc.)
    • Or write SVG from scratch
  2. Write the SVG file

    # Example: Write SVG to file
    write('/path/to/output.svg', svg_content)
    
  3. Convert to PNG

    /root/.openclaw/workspace/skills/svg-draw/scripts/svg_to_png.sh input.svg output.png 400 400
    

SVG Structure Tips

Always include:

  • \x3Csvg> tag with xmlns="http://www.w3.org/2000/svg" and viewBox
  • Background \x3Crect> (prevents transparent backgrounds)
  • Appropriate width and height attributes

Common SVG elements:

  • Shapes: \x3Crect>, \x3Ccircle>, \x3Cellipse>, \x3Cpolygon>, \x3Cpath>
  • Text: \x3Ctext> with text-anchor="middle" for centering
  • Colors: Use hex codes or named colors
  • Opacity: Add opacity attribute for transparency effects

Example character structure:

Background → Body → Head → Face features → Limbs → Accessories → Name

Converting SVG to PNG

Use the bundled conversion script:

/root/.openclaw/workspace/skills/svg-draw/scripts/svg_to_png.sh \x3Cinput.svg> \x3Coutput.png> [width] [height]

Parameters:

  • input.svg: Source SVG file path
  • output.png: Destination PNG file path
  • width: Output width in pixels (default: 400)
  • height: Output height in pixels (default: 400)

Example:

/root/.openclaw/workspace/skills/svg-draw/scripts/svg_to_png.sh dragon.svg dragon.png 512 512

Available Templates

Dragon Template (assets/dragon_template.svg)

Blue dragon with:

  • Serpentine body with wings
  • Golden eyes with highlights
  • Horns and pointed ears
  • Curved tail
  • Magical sparkles
  • Name label: "大龙 🐉"

Customization ideas:

  • Change fill="#4a90d9" for different body colors
  • Adjust eye color by modifying fill="#ffcc00"
  • Add/remove features (scales, fire, etc.)
  • Change background color

Lobster Template (assets/lobster_template.svg)

Red lobster with:

  • Orange-red shell with segments
  • Large claws (left and right)
  • Eight walking legs
  • Eyes on stalks
  • Long antennae
  • Tail fan
  • Ocean bubbles background
  • Name label: "大龙虾 🦞"

Customization ideas:

  • Adjust shell color: fill="#e85d04" (darker red) or fill="#f48c06" (orange)
  • Change claw size or position
  • Add more bubbles
  • Modify background

Design Guidelines

Color Palettes

Friendly/Cute:

  • Body: #4a90d9 (blue), #f48c06 (orange)
  • Accents: #ffcc00 (yellow), #ff6b6b (coral)
  • Background: #1a1a2e (dark blue)

Professional:

  • Use muted tones
  • Stick to 2-3 main colors
  • Add subtle gradients if needed

Character Design Principles

  1. Keep it simple — Too many details look messy at small sizes
  2. Use contrast — Light features on dark backgrounds
  3. Add personality — Eyes, expressions, small details
  4. Include a label — Add name/title at the bottom for context
  5. Test at target size — View at 400x400 to check readability

Common Tasks

Creating an Avatar

  1. Start with a template that matches the vibe (dragon, lobster, etc.)
  2. Modify colors and features
  3. Add personal touches (accessories, expressions)
  4. Add name label at bottom
  5. Convert and send

Making a Logo

  1. Use simple geometric shapes
  2. Limit to 2-3 colors
  3. Consider scalable design
  4. Test at multiple sizes
  5. Export at higher resolution (800x800 or 1024x1024)

Customizing Templates

Change colors: Find fill="#" or stroke="#" attributes and replace the hex codes

Resize elements: Adjust rx, ry (ellipses) or width, height (rectangles)

Reposition: Modify cx, cy (circles/ellipses) or x, y (rectangles)

Add text:

\x3Ctext x="200" y="370" font-family="Arial, sans-serif" font-size="24" font-weight="bold" fill="#ffcc00" text-anchor="middle">Your Text\x3C/text>

Resources

scripts/

  • svg_to_png.sh - Convert SVG to PNG using rsvg-convert

assets/

  • dragon_template.svg - Friendly blue dragon
  • lobster_template.svg - Cute red lobster

Troubleshooting

SVG not rendering:

  • Check for proper \x3Csvg> tag with xmlns attribute
  • Ensure viewBox is set correctly
  • Verify all tags are closed

Conversion fails:

  • Confirm rsvg-convert is installed: which rsvg-convert
  • Check file paths are correct
  • Verify SVG syntax is valid

Image looks wrong:

  • Test SVG in browser first
  • Check coordinate system (viewBox vs width/height)
  • Verify element stacking order (later elements draw on top)
安全使用建议
This skill appears to do exactly what it claims: produce SVG text (templates included) and convert with rsvg-convert. Before installing, ensure rsvg-convert is present on your system and be aware the skill will write SVG/PNG files to the agent workspace (examples use /root/.openclaw/workspace/...). As with any SVG converter, avoid converting untrusted SVGs that might reference external resources or exploit parser bugs—inspect SVG content before converting or run conversions in a sandboxed environment. If you want less reliance on absolute paths, adjust the example invocation to use your environment's workspace path.
功能分析
Type: OpenClaw Skill Name: svg-draw Version: 1.0.0 The skill bundle is benign. The `SKILL.md` provides clear instructions for generating SVG content and converting it to PNG using the `scripts/svg_to_png.sh` script. This script, in turn, uses the `rsvg-convert` system utility, which is explicitly mentioned in the skill's description and aligns with its stated purpose. There is no evidence of prompt injection attempts against the agent, data exfiltration, malicious execution, persistence mechanisms, or obfuscation. The SVG template files (`assets/*.svg`) are standard and do not contain any active or malicious content.
能力评估
Purpose & Capability
Name/description match the included assets (SVG templates) and a small conversion script. The skill does not request unrelated credentials or binaries.
Instruction Scope
SKILL.md instructs the agent to write SVG files and run the provided conversion script (expected). It uses an absolute path (/root/.openclaw/workspace/skills/svg-draw/...) in examples — this is environment-specific but not malicious. It also mentions sending images via messaging channels but provides no external endpoints or credentials.
Install Mechanism
No install spec; the only executable is a small, non-obfuscated shell script that calls the system rsvg-convert. No downloads or archive extraction are present.
Credentials
The skill requires no environment variables or credentials. Its runtime dependency (rsvg-convert) is declared in troubleshooting and is proportional to the PNG conversion function.
Persistence & Privilege
always:false and the skill does not request permanent presence or modify other skills/config. It writes/reads files in its own workspace per instructions, which is normal for an instruction-only skill.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install svg-draw
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /svg-draw 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
SVG-draw 1.0.0 initial release: - Generate SVG vector graphics by writing SVG code directly—no external graphics libraries required. - Convert SVG images to PNG format using the included script leveraging system rsvg-convert. - Includes customizable templates for dragon and lobster illustrations. - Detailed design guidelines for avatars and logos. - Step-by-step instructions for SVG creation, conversion, and customization. - Troubleshooting section for common SVG and conversion issues.
元数据
Slug svg-draw
版本 1.0.0
许可证
累计安装 19
当前安装数 19
历史版本数 1
常见问题

SVG Draw 是什么?

Create SVG images and convert them to PNG without external graphics libraries. Use when you need to generate custom illustrations, avatars, or artwork (e.g., "draw a dragon", "create an avatar", "make a logo") or convert SVG files to PNG format. This skill works by writing SVG text directly (no PIL/ImageMagick required) and uses system rsvg-convert for PNG conversion. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 3575 次。

如何安装 SVG Draw?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install svg-draw」即可一键安装,无需额外配置。

SVG Draw 是免费的吗?

是的,SVG Draw 完全免费(开源免费),可自由下载、安装和使用。

SVG Draw 支持哪些平台?

SVG Draw 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 SVG Draw?

由 LiJY2015(@lijy2015)开发并维护,当前版本 v1.0.0。

💬 留言讨论