Convert SVG files to raster image formats (PNG, JPEG, WebP, AVIF, TIFF, GIF, HEIF, or JXL) at custom resolution and DPI. Also supports batch conversion of multiple SVGs.
The batch endpoint streams a ZIP file directly with headers:
-`Content-Type: application/zip`
-`X-Job-Id: <jobId>`
-`X-File-Results: <url-encoded JSON mapping of index to filename>`
## Notes
- Only accepts SVG and SVGZ files (validates content, not just extension). SVGZ is automatically decompressed.
- SVG content is sanitized before rendering to prevent XSS and external resource loading.
- The `dpi` setting controls the density at which the SVG is rasterized. Higher DPI produces larger pixel dimensions from the same SVG viewport.
- When both `width` and `height` are provided, the image is resized using `fit: inside` (maintains aspect ratio within the bounds).
- A `previewUrl` is included in the response for formats that browsers cannot display natively (TIFF, HEIF). The preview is a 1200px WebP thumbnail.
- The default background `#00000000` is fully transparent. Set to `#FFFFFF` for a white background (useful with JPEG output which does not support transparency).
- Batch processing respects the `MAX_BATCH_SIZE` server configuration and uses concurrent workers for performance.
- Progress for batch operations can be tracked via SSE at `/api/v1/jobs/:jobId/progress`.