render_svg
Renders SVG source code to high-quality PNG or SVG. Automatically selects the best backend for filter effects like glow and blur.
Instructions
Render SVG source to high-quality PNG or SVG. Dual backend: resvg (92% filter fidelity, in-process, lightweight) or Chrome (100% filter fidelity, needs system Chrome/Edge). AUTO-selects: if SVG contains // AND Chrome is available → Chrome; else resvg. Use this for '酷炫/霓虹/科技感' graphics with glow/blur/depth that D2 cannot produce — write the SVG (with feGaussianBlur, radial gradients, etc.) and this tool renders it. No AI.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| svg | Yes | SVG source code (XML string starting with <svg). Can include feGaussianBlur, feMerge, gradients, patterns — all SVG filter primitives supported. | |
| name | No | Output filename (without extension) | |
| scale | No | Retina scale factor for Chrome backend (default 2; only affects Chrome renders) | |
| width | No | Target pixel width for PNG (default: auto-detect from SVG viewBox/width) | |
| format | No | Output format (png = rasterized; svg = pass-through) | png |
| outDir | No | Output directory, default session-dir/output | |
| backend | No | Rendering backend: 'auto' = detect filters + Chrome availability; 'resvg' = force lightweight (92%); 'chrome' = force Chrome (100%, needs Chrome installed) | auto |