/svg-to-png:svg-to-pngfrom svg-to-png
Converts SVG files to high-quality PNG using sharp, with control over dimensions, background color, and CSS rendering. Supports batch generation of app icons, splash screens, and favicons.
Ships in svg-to-png. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Convert SVG to high-quality PNG using sharp with automatic density calculation.
Ensure sharp is installed in the project (npm install sharp). Install it if missing before running the script.
scripts/convert_svg.mjs — the main conversion script.
node scripts/convert_svg.mjs --input logo.svg --output logo.png --width 1024
node scripts/convert_svg.mjs --input logo.svg --width 512 --height 512 --background "#1a1a2e"
Arguments:
--input / -i (required): Path to input SVG--output / -o: Output PNG path (defaults to <input-name>.png)--width / -w: Target width in pixels--height / -h: Target height in pixels--background / -b: Background color (hex or named). Default: transparentGenerate multiple PNGs from one SVG using built-in presets:
node scripts/convert_svg.mjs --input logo.svg --preset app-icon --output-dir ./icons
node scripts/convert_svg.mjs --input logo.svg --preset splash-portrait --output-dir ./splash
Arguments:
--preset / -p: Preset name (see below)--output-dir / -d: Output directory (created automatically)Available presets: app-icon, splash-portrait, splash-icon, favicon, og-image.
For preset details and sizes, see references/presets.md.
sharp rasterises SVG at a given DPI (density). The script auto-calculates:
density = 72 * target_width / svg_viewbox_width
A 100-wide viewBox rendered at 1024px uses density 737, producing crisp output. No manual tuning needed.
--background を指定しなければ背景は透明。SVG の背景色をそのまま活かせる。通常は背景色指定不要。app-icon プリセットは自動で白背景にフォールバック。<path> outlines in the SVG to avoid font-not-found issues on other machines.var()): Not supported by librsvg. Replace with literal values before conversion.splash-icon preset for the single image referenced by splash.image in app config.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub sean-sunagaku/claude-code-plugin --plugin svg-to-pngOther plugins' skills for the same job