From image-production
Use when the user wants to rasterize SVG files — convert SVG to PNG, PDF, or PostScript at a chosen resolution. Wraps CairoSVG (Python, in the plugin venv). Single file or batch. Companion to `vectorize` (other direction).
npx claudepluginhub danielrosehill/claude-code-plugins --plugin image-productionThis skill uses the workspace's default tool permissions.
Rasterize SVG files to PNG / PDF / PS via [CairoSVG](https://github.com/Kozea/CairoSVG). Runs from the plugin's uv venv — no system Python pollution.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
Rasterize SVG files to PNG / PDF / PS via CairoSVG. Runs from the plugin's uv venv — no system Python pollution.
Do not use this skill when:
vectorize instead.png (default), pdf, ps.<input-dir>/<format>/. Never overwrites originals.1.0. Use 2.0, 3.0 for hi-DPI.96.#ffffff, white) for solid fill.--recursive for directory descent.Resolve venv: VENV_DIR="${CLAUDE_USER_DATA:-${XDG_DATA_HOME:-$HOME/.local/share}/claude-plugins}/image-production/venv".
Verify cairosvg is importable in the venv:
"$VENV_DIR/bin/python" -c "import cairosvg" 2>&1
If missing → point at install-deps. If it imports but raises a libcairo error, surface the system-lib install command (sudo apt install libcairo2 / brew install cairo).
Enumerate *.svg inputs (case-insensitive). Skip non-SVG with note.
For each file, call CairoSVG via Python one-liner (keeps the skill self-contained — no helper script needed):
"$VENV_DIR/bin/python" -c "
import cairosvg, sys
kwargs = {'url': sys.argv[1], 'write_to': sys.argv[2]}
# Inject scale / dimensions / dpi / background as appropriate
cairosvg.svg2png(**kwargs) # or svg2pdf / svg2ps
" "<input.svg>" "<output.png>"
Function map: png → svg2png, pdf → svg2pdf, ps → svg2ps.
Optional kwargs: scale=<float>, output_width=<int>, output_height=<int>, dpi=<int>, background_color="<css>".
Track file sizes and any render warnings (CairoSVG prints to stderr for unsupported features).
<output-dir>/.--scale values, or wrap in a small loop.inkscape --export-type=png). CairoSVG is the lighter-weight pure-Python option.