apyhub
Back

Convert Image File to PNG/JPEG API

What it does

Media Converter turns an uploaded image into a PNG or JPEG and returns the converted file as binary output. Send the file, choose the target format, and get back a ready-to-use image for storage, delivery, or further processing.

Use format to select png or jpeg. When you convert to JPEG, you can also set quality from 0 to 1 to control compression, and optionally provide backgroundColor to fill transparent areas such as #ffffff. The input image accepts files up to 15 MB.

Use Media Converter when you need to standardize uploads before saving them, prepare assets for a web workflow, or re-encode images for systems that only accept a specific format. It is useful in pipelines that receive mixed image types and need one consistent output.

The response is a binary file, so you can store it directly, pass it to another service, or attach it to a download response without extra parsing.

POST
Convert an image to PNG or JPEG
https://api.eu.apyhub.com/freedailypro/convert-image-to-png-or-jpeg-api/image-convert

QUICKSTART

GUIDE

Quickstart

Convert an image to PNG or JPEG by uploading the source file with the required format.

curl -X POST "https://api.eu.apyhub.com/freedailypro/convert-image-to-png-or-jpeg-api/image-convert" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/image" \
  -F "format=png"

What you'll get back

Returns a binary file (string with format: binary) containing the converted image data. The response is the image itself, not JSON.

TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
The image. Up to 15 MB.
png or jpeg
JPEG quality, 0 to 1
Fill for transparent areas when converting to JPEG, for example #ffffff

About this endpoint

What it does

Converts an uploaded image file to PNG or JPEG and returns the converted image as binary data. The request body includes the source file and output format, with optional JPEG-specific settings.

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe image file to convert. Binary upload. Up to 15 MB.
formatENUMYesOutput format. Allowed values: png, jpeg.
qualityNumberNoJPEG quality, from 0 to 1.
backgroundColorStringNoFill color for transparent areas when converting to JPEG, for example #ffffff.

Response

Returns a binary file containing the converted image.

ParameterTypeMandatoryDescription
dataStringYesBinary response body containing the converted image file.

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.