Skip to main content
Glama

SVG to PNG

image_svg_to_png
Read-onlyIdempotent

Converts SVG files or code into crisp PNG images at a set scale or exact pixel size, with transparent or solid backgrounds and unit-aware dimensions.

Instructions

Rasterise an SVG to a crisp PNG: scale (1×, 2×, 3×, 4×… default 2×), a target width or height (aspect kept), or an exact size (stretched). Units (px, pt, mm, cm, in) and viewBox-only SVGs are understood; transparent background or a solid colour. Scripts, event handlers and external references are removed first. Name @2x.png. Web version: https://s3eidat.github.io/svg-to-png/

Input Schema

NameRequiredDescriptionDefault
svgNoThe SVG: a local path or base64 / data URI.
modeNoHow to size the PNG. Default scale.scale
scaleNoScale factor for mode "scale". Default 2.
widthNoWidth in px for modes width / exact.
heightNoHeight in px for modes height / exact.
outputNoWhere to write the result: a file path, or a folder ending in "/". Default: the server output folder (a temp folder unless --out-dir is set).
svgTextNoOr: the SVG code itself.
backgroundNoBackground colour when transparent is false. Default #ffffff.#ffffff
transparentNoKeep the background transparent. Default true.
returnBase64NoAlso return the output as base64 in the result (only for small files). Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and idempotent, but the description adds real behavioral value: scripts, event handlers and external references are stripped before rasterising, and the default output lands in a server temp folder unless --out-dir is set. The naming convention (<name>@2x.png) is also disclosed. It doesn't cover failure modes or size limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single dense paragraph that front-loads the core action and sizing modes before edge details (sanitization, naming, web link). Every clause carries information, though it is packed tightly rather than scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter tool with no output schema, the description covers the mode semantics, units, background handling, sanitization and output naming, which is most of what an agent needs. The base64 return option and output path are left to the schema, which is adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline would be 3, but the description adds genuine meaning the schema lacks: 'width or height (aspect kept)' versus 'exact size (stretched)' clarifies the semantic difference between modes, and it lists supported units (px, pt, mm, cm, in). This goes beyond restating the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource: 'Rasterise an SVG to a crisp PNG.' The sizing modes (scale, width/height, exact) further pin down what the tool produces, which separates it from generic siblings like image_convert or image_resize. It never names a sibling explicitly, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when the tool fits by enumerating the sizing strategies and unit handling, and points to a web version. But it never states when NOT to use it or which sibling (e.g. image_convert) to prefer for non-SVG input. Usage is inferred rather than directed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools