Bytefusedocs

Image

Convert Image

Convert an image to another format — PNG, JPG, WebP, AVIF, BMP, TIFF or GIF. Because a target format is specified, PNG output stays lossless.

Free to try — no key required 10 credits / callSynchronous

Overview

Upload an image and name a target format; receive a public R2 URL for the converted file. On the free-try path.

POSThttps://api.bytefuse.in/api/v1/image/convert

Request

Content type multipart/form-data:

filefilerequired
The image to convert.
target_formatstringrequired
Output format — png, jpg, webp, avif, bmp, tiff, or gif. AVIF needs the optional server plugin, else 422.
qualityintoptional
1–100, applies to JPEG/WebP/AVIF.Default: 85

Response

200 OK, application/json — same shape as the other image tools:

200 OK
{
  "success": true,
  "url": "https://<r2-host>/image/20260704/<uuid>.webp",
  "meta": {
    "format": "WEBP",
    "width": 1920,
    "height": 1080,
    "output_size": 240000,
    "processing_time_ms": 160
  },
  "credits_charged": 1
}

url is a public R2 link (no expires_at). X-Credits-Charged mirrors credits_charged (0 anonymous).

Examples

curl -X POST https://api.bytefuse.in/api/v1/image/convert \
  -F "file=@photo.png" \
  -F "target_format=webp" \
  -F "quality=82"

Errors

422Missing/invalid target_format, an unavailable format, an invalid image, or quality out of range.
402 / 429 / 503Insufficient credits (authenticated), rate limited, or capacity/config error.
500The image engine failed unexpectedly.