Image

SVG to Image

0calls
1 credits / call

Need to convert flexible SVG vector graphics to common raster image formats? This endpoint can help you achieve this easily.

Overview

Upload an SVG file and specify the target format (such as PNG, JPEG, etc.), the endpoint will return the converted image. You can also adjust the output image size and (for JPEG) compression quality to meet the needs of different scenarios.

Query parameters

format
stringoptional

Target format of the output image. Supported values: png, jpeg, jpg, gif, tiff, bmp.

width
integeroptional

Width of the output image (pixels). If omitted, aspect ratio will be maintained based on height, or the original width of the SVG will be used.

height
integeroptional

Height of the output image (pixels). If omitted, aspect ratio will be maintained based on width, or the original height of the SVG will be used.

quality
integeroptional

Compression quality for JPEG images (1-100). Only valid when format is jpeg or jpg.

Request body

SVG file to convert.

file
fileoptional

Supports SVG files

Response

200 / OK

Conversion successful! Response body is binary data of the converted image.

image/*

400 / Bad Request

Invalid request. This could be due to no file uploaded or an unsupported output format specified.

JSON

500 / Internal Server Error

Internal server error. An error occurred during SVG rendering or file processing.

JSON