
Image Converter API
Design
Convert images between JPG, PNG, WebP, HEIC, GIF, BMP, AVIF, SVG, ICO and PDF in your browser, in bulk, with quality, background colour and resize options.
Authentication
All API requests require a valid API key passed in the Authorization header as a Bearer token.
Rate Limit
20 requests per minute
Endpoints
1 endpoint available
Overview
Convert an image to JPG, PNG, WebP, AVIF, GIF, BMP, ICO or PDF. Send the image as multipart form data in the
file field. The response body is the converted file, named after the upload with the new
extension.
Output formats
jpg,webp,avif: lossy, usingquality. JPG has no transparency, so transparent areas get thebackgroundcolour.png: lossless, keeps transparency.gif: one frame, up to 256 colours.bmp: uncompressed 24-bit bitmap; transparency is filled withbackground.ico: 16, 32, 48 and 256 px icons in one file (small images skip sizes over twice their size).maxWidthandmaxHeightare ignored.pdf: one page sized to the picture, stored as a JPG atquality.
Notes
- Accepted input: JPEG, PNG, WebP, GIF (first frame), AVIF, TIFF and SVG, up to 20 MB and 50 megapixels. BMP, ICO and HEIC input are not supported by the API (the web page can read them in your browser) and return 415.
maxWidthandmaxHeightfit the image inside a box, keeping its shape. Raster images are never enlarged; SVGs are drawn at the size that fills the box. The output can be at most 10000 pixels per side.- The EXIF orientation is applied, and metadata such as GPS and camera details is removed.
Endpoints
POST
https://opentools.ca/api/v1/tools/image-converterConvert an image to another format
Request Body
Content-Type: multipart/form-data
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | file | Required | The image, up to 20 MB and 50 megapixels. JPEG, PNG, WebP, GIF (first frame), AVIF, TIFF or SVG. |
| to | string Enum: jpg, png, webp, avif, gif, bmp, ico, pdf | Optional | Output format.Default: jpg |
| quality | number | Optional | Quality from 30 to 100, for jpg, webp, avif and pdf.Default: 85 |
| background | string | Optional | Hex colour (#rrggbb) that fills transparent areas in jpg, bmp and pdf.Default: #ffffff |
| maxWidth | number | Optional | Maximum width in pixels, 1 to 10000. Blank means no limit. |
| maxHeight | number | Optional | Maximum height in pixels, 1 to 10000. Blank means no limit. |
Response Example
HTTP/1.1 200 OK
Content-Type: image/png
Content-Disposition: attachment; filename="holiday.png"
<binary file data>Error Codes
400
Bad Request - Missing file, invalid option, or output over 10000 pixels per side401
Unauthorized - Invalid or missing API key403
Forbidden - API key is inactive or expired, or the request IP is not allowed413
Payload Too Large - File over 20 MB or image over 50 megapixels415
Unsupported Media Type - Not an image the server can read (BMP, ICO and HEIC are not supported)429
Too Many Requests - Rate limit exceeded500
Internal Server ErrorCode Examples
curl -X POST https://opentools.ca/api/v1/tools/image-converter \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@holiday.webp" \
-F "to=jpg" \
-F "quality=90" \
-F "maxWidth=2000" \
-o holiday.jpgRather use it in your browser? Open the Image Converter