Image Optimization API

Resize and convert phone photos to JPEG, WebP or PNG, one at a time or 250 per batch.

Resize, convert and compress images. Reads iPhone HEIC, applies EXIF rotation before stripping metadata, and converts Display P3 to sRGB so colours survive. JPEG output is baseline unless you ask for progressive. A batch charges only for the images that succeeded.

What it does

  • Applies EXIF rotation before stripping metadata, so nothing ends up sideways
  • Baseline JPEG by default, which is what a PDF needs
  • Display P3 to sRGB conversion, so iPhone photos keep their colours
  • One bad image never fails the rest of a batch
  • A batch charges only for the images that succeeded

Endpoints

MethodPathDescriptionModes
POST /v1/image/optimize Optimize one image sync
POST /v1/image/batch Optimize up to 250 images sync, async (sync: 10 images)

Base URL: https://api.justapi.tech

Pricing

OperationPrice
Optimize$0.0008per image
Batch$0.0008per image that succeeded, no batch surcharge

You are not charged for a failed request, and never for a job whose output is not smaller than its input.

Limits

Max File Size50 MB per image
Max Batch250 images
OutputJPEG, WebP, PNG
InputJPEG, PNG, WebP, HEIC

The details that quietly ruin photo pipelines

Four things go wrong in almost every photo-to-PDF pipeline. All four are handled by default here.

EXIF orientation. Rotate the pixels first, then strip the metadata. Otherwise every landscape photo ends up sideways.

Progressive JPEG. Invalid inside a PDF. We emit baseline unless you ask otherwise.

Display P3. iPhones shoot in a wide gamut. Without an explicit conversion to sRGB, colours come out washed out or oversaturated.

HEIC. Detected from magic bytes and decoded properly, instead of failing on a file that looks fine on the phone.

One call instead of two hundred and fifty

curl https://api.justapi.tech/v1/image/batch \
  -H "Authorization: Bearer ak_live_..." \
  -d '{"images":[{"url":"...","ref":"photo_01"}],"options":{"width":1600,"max_bytes":250000}}'

Up to 250 images per call, processed in parallel across the provider pool, with per-image failures that do not take down the batch. There is no batch surcharge: you pay the same as 250 individual calls and save 249 round trips.

Drop-in URL transforms

If you already serve images through a transform URL, the pattern is the same shape:

https://img.justapi.tech/t/{key_id}/w_1200,q_76,f_jpg/{file_id}

Cached at the edge, so the second request for the same transform is a cache hit and costs nothing.