svg_to_png
Rasterize a self-contained SVG file to PNG locally, blocking external references and publishing output atomically so failures do not overwrite existing files.
Instructions
Rasterize a self-contained SVG file to a PNG image.
The conversion runs locally on CPU. External file and network references
are blocked; embedded ``data:`` resources remain supported. Rendered output
is limited to 8192 pixels per side and 32 million total pixels, then
validated and atomically published so a failure cannot replace an existing
destination with partial bytes.
Args:
file_path: Absolute path to the .svg file.
output_path: Absolute path for the output .png file. If empty, the
PNG is saved beside the source with the same stem.
scale: Positive scale factor up to 16. Cannot be combined
with output_width or output_height.
output_width: Optional positive pixel width. If output_height is
omitted, the aspect ratio is preserved.
output_height: Optional positive pixel height. If output_width is
omitted, the aspect ratio is preserved.
background_color: Optional CSS color for otherwise transparent pixels.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | ||
| file_path | Yes | ||
| output_path | No | ||
| output_width | No | ||
| output_height | No | ||
| background_color | No |