---
title: Convert Image File to PNG/JPEG API
slug: convert-image-to-png-or-jpeg-api
url: https://apyhub.com/freedailypro/service/convert-image-to-png-or-jpeg-api
provider: FreeDailyPro
tags: [image, image converter, convert image, png, jpeg, jpg, image format, image processing]
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 1
atoms: 10
mcp: true
---

# Convert Image File to PNG/JPEG API

Convert images to PNG or JPEG with one API call. Upload up to 15 MB, set JPEG quality from 0 to 1, and get the converted file back.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/freedailypro/convert-image-to-png-or-jpeg-api/image-convert` | What it does Converts an uploaded image file to PNG or JPEG and returns the converted image as bina… | 10 |

## Endpoint reference

### Convert an image to PNG or JPEG

`POST https://api.eu.apyhub.com/freedailypro/convert-image-to-png-or-jpeg-api/image-convert` · 10 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes | The image. Up to 15 MB. |
| `format` | body | string | yes | png or jpeg One of: png, jpeg. |
| `quality` | body | number | no | JPEG quality, 0 to 1 |
| `backgroundColor` | body | string | no | Fill for transparent areas when converting to JPEG, for example #ffffff |

#### Quickstart

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

```bash
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.

## About

## 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.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/freedailypro/service/convert-image-to-png-or-jpeg-api
