Free image compression API
Drop a JPEG, PNG or WebP and get it back in the same format, saved again to be smaller, with the camera and GPS data removed. The form calls the same free API your code can call: one POST, no API key and no account. The result waits in Storage for 24 hours.
curl -s -X POST https://aisenseapi.com/services/v1/image_compress \
-F "file=@photo.jpg" \
-F "quality=70"
{
"storage_id": "f87efab2-9d0d-46e4-b1d8-8b8776ab0a21",
"storage_url": "https://aisenseapi.com/services/v1/storage/f87efab2-9d0d-46e4-b1d8-8b8776ab0a21",
"sha256_hash": "6c930ff8216f4c681e85d1f7558ca7b4f7c9d6c6a988187d2b8df2d485876f03",
"bytes": 260768,
"expire_timestamp": 1790767674,
"expire_datetime": "2026-09-30T11:27:54+00:00",
"content_type": "image/jpeg",
"filename": "result.jpg",
"operation": "image_compress",
"format": "jpeg",
"width": 1600,
"height": 1200,
"input_format": "jpeg",
"input_bytes": 641358
}Try it in the browser
This form posts your image to the same endpoint and shows the stored result. The image is sent to aisenseapi.com, and the result is kept for 24 hours at a link that anyone with the link can open.
How the compression works
- The format stays the same. A JPEG comes back a JPEG, a PNG a PNG and a WebP a WebP. The image converter changes the format.
- JPEG and WebP are saved again at the quality you choose, 82 when you choose none. That is lossy: the lower the quality, the smaller the file and the more fine detail is lost.
- PNG is saved again losslessly with the strongest zlib compression. Every pixel stays the same, and PNG takes no quality.
- The image is turned upright from the orientation a phone camera writes in the EXIF data, before that data is removed.
- EXIF, XMP, IPTC and comments are removed, so the camera, the GPS position, the date and the software do not follow the image. The ICC colour profile is kept, so the colours stay the same. A CMYK JPEG is converted to RGB.
- Nothing is resized. An image the EXIF data marks as rotated is turned upright, which swaps its width and height; any other keeps both.
- The answer says what was saved.
input_bytesis the upload andbytesthe result. An image that was already saved at a lower quality, or compressed well already, can come out larger. Then keep the original.
The API
POST https://aisenseapi.com/services/v1/image_compress with multipart/form-data.
| Field | Required | Meaning |
|---|---|---|
file | yes | The image: JPEG, PNG or WebP. |
quality | no | 40 to 95, for JPEG and WebP. 82 when left out. A PNG takes none. |
A format field is refused; the result always has the format of the upload. A GET on storage_url returns the image with its own image type.
The answer is a Storage link
The endpoint never sends the image in its answer. It stores the result for 24 hours and answers with the same fields the Temporary Storage API answers with, plus what the result is:
| Field | Meaning |
|---|---|
storage_id, storage_url | Where the result is. A GET on the URL returns the image. |
sha256_hash, bytes | The digest and size of the stored image. |
expire_timestamp, expire_datetime | When the result is removed, 24 hours after it was stored. |
content_type, filename | The type of the image and the name to save it under. |
operation, format, width, height | The endpoint that made it, and the format and size of the result in pixels. |
input_format, input_bytes | What the upload was, so the saving can be read off. |
The example at the top of the page comes from a test run with a test image of 1600 x 1200 pixels. The id and the expiry are different on every call, and the sizes depend on the image.
Anyone with the link can open the image until it expires, so do not send pictures of people or anything confidential. Stored results count against the Storage budget of 80 MB per IP address per day.
Limits
- The upload is at most 10 MB and 25 megapixels.
- The result is at most 8 MB. A photo saved as PNG often goes over that; as JPEG or WebP it is far smaller.
- WebP allows at most 16383 pixels per side.
- One conversion may take at most 45 seconds.
- At most two images are converted at a time. A third waits up to ten seconds and is then answered 503 with
Retry-After.
Errors
A refused request stores nothing and answers with error. The endpoint's own refusals also carry fix, a sentence saying what to send instead.
| Status | When |
|---|---|
400 | A field is missing, unknown or out of range, the upload is not one whole file, or ImageMagick cannot read the image. |
405 | The method is not POST. |
413 | The upload, its number of pixels or the result is over a limit. |
415 | The body is not multipart/form-data, or the file is not a JPEG, PNG or WebP. |
429 | More than 5000 requests from one IP address in 24 hours, or the day's Storage budget is used up. |
503 | Two images are being converted already, the conversion took more than 45 seconds, or the service cannot convert right now. |
Questions
Is the image compression API free?
Yes. No API key, no account and no sign up. The limit is 5000 requests per IP address per 24 hours, and stored results count against the Storage budget of 80 MB per IP address per day.
Is the compression lossless?
For PNG, yes. JPEG and WebP are saved again at the quality you choose, which is lossy.
Why is my result larger than the upload?
The image was already compressed harder than the quality you chose. Keep the original, or choose a lower quality.
Does it resize the image?
No. An image the EXIF data marks as rotated is turned upright, which swaps its width and height. Any other image keeps both.
Related tools
- Image converter and image compression for JPEG, PNG and WebP
- JSON to CSV, CSV to JSON and table matching
- JSON formatter and JSON validator
- File uploader and the Temporary Storage API, where every result is kept for 24 hours