SVG to PNG & WebP High-DPI Renderer API
svg_to_png_apiRender SVG vector graphics into crisp high-DPI PNG, WebP, or JPEG raster images with custom width, height, scale factor (up to 4x), transparent or hex background fill, and quality control. Blocks DTD/XXE and external network references for safe server-side rendering. Deterministic, sub-second latency, nothing stored. Usable from AI agents via MCP. Free: 5 calls/day per IP. Paid: Radar API key (from €15/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.01/call via x402 at https://radarbg.com/x402/svg-to-png-api.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"120\" height=\"40\" viewBox=\"0 0 120 40\"><rect width=\"120\" height=\"40\" rx=\"8\" fill=\"#0f766e\"/><text x=\"60\" y=\"25\" font-family=\"DejaVu Sans\" font-size=\"14\" fill=\"#ffffff\" text-anchor=\"middle\">READY</text></svg>",
"width": 240,
"format": "png"
},
"name": "svg_to_png_api"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| svg | No | Raw SVG XML markup string (provide either svg or fileBase64, max 5 MB). | |
| scale | No | Scale multiplier when width/height are omitted (0.25-4, e.g. 2 for retina). | |
| width | No | Optional target width in pixels (aspect ratio preserved if height omitted). | |
| format | No | Output image format: png, webp, or jpeg. | png |
| height | No | Optional target height in pixels. | |
| quality | No | Compression quality for WebP/JPEG (1-100). | |
| background | No | Optional 6-digit hex background color (e.g. #ffffff). Omit for transparent PNG/WebP. | |
| fileBase64 | No | Base64-encoded SVG or gzipped SVG file (alternative to svg). |