svg-to-png

将 SVG 矢量图片转换为 PNG 格式,支持指定尺寸。使用场景:(1) 将 SVG 图标转换为 PNG,(2) 调整图片尺寸,(3) 前端资源格式转换。使用前需在当前目录安装 sharp 依赖。

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 13 · 0 current installs · 0 all-time installs
bytianling@try520
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (SVG → PNG conversion, size option) matches the included JavaScript (scripts/convert.js) which uses the sharp library to read an SVG, resize, and write a PNG. Declared requirements (install sharp locally) are appropriate for the stated purpose.
Instruction Scope
SKILL.md instructs installing sharp and running node scripts/convert.js with path and size args. The script only reads the specified SVG file, checks existence, resizes, and writes a PNG; it does not access environment variables, other files, network endpoints, or modify system state. No scope creep detected.
Install Mechanism
There is no automated install spec; the README instructs running 'npm install sharp' which is standard. package.json and package-lock.json reference sharp and its platform-specific binaries; no downloads from untrusted, shortened, or personal URLs are present in the package files provided.
Credentials
The skill requests no environment variables or credentials and the script does not read any. This is proportional for a local file-conversion utility.
Persistence & Privilege
The skill is user-invocable, not always-enabled, and contains no code that attempts to persist configuration, modify other skills, or alter system-wide agent settings.
Assessment
This skill appears internally consistent and does what it claims: it uses sharp to convert an SVG file to a PNG at a specified size. Before installing/using: (1) install sharp locally via npm in a project directory you control; (2) be cautious processing untrusted SVGs—SVGs can reference external resources or be crafted to cause excessive CPU/memory during rasterization—so run on isolated inputs or sandboxed environments if input is untrusted; (3) verify you install sharp from the official npm registry and that native build prerequisites for sharp/libvips are met on your platform. If you need stronger isolation, run the conversion in a container or VM.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.0
Download zip
latestvk97cmeqv4tsk194s7gc554775n837yh7

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

SVG 转 PNG 技能 🖼️

安装依赖

在使用该技能前,需要在当前目录安装 sharp:

npm install sharp

使用方法

node <skill>/scripts/convert.js <输入SVG路径> [输出PNG路径] [尺寸]

参数说明

参数必填默认值说明
输入SVG路径-要转换的 SVG 文件路径
输出PNG路径同名 .png输出文件路径
尺寸1024输出图片宽高(正方形)

示例

# 转换并输出 1024x1024
node skills/svg-to-png/scripts/convert.js icon.svg icon.png 1024

# 使用默认尺寸 1024
node skills/svg-to-png/scripts/convert.js icon.svg icon.png

# 指定不同尺寸
node skills/svg-to-png/scripts/convert.js logo.svg logo.png 512

工作原理

使用 sharp 库读取 SVG 文件,调整为指定尺寸后输出为 PNG 格式。

Files

4 total
Select a file
Select a file to preview.

Comments

Loading comments…