Resize Image Online
Resize, crop, rotate, flip and convert images between PNG and JPEG with high-quality resampling and adjustable JPEG quality to shrink file size.
Result
Press “Run” to see the result.
The image resize API transforms an uploaded PNG or JPEG. Set width and / or height (the other side keeps the aspect ratio) and a fit: inside (default, fits in the box), cover (fills the box and crops the centre, ideal for thumbnails), contain (fits and pads with a background colour) or fill (stretches). crop=x,y,width,height cuts a region first, rotate (90, 180, 270) and flip (horizontal, vertical) fix orientation, and no_enlarge=true never upscales.
Shrinking uses area averaging, which keeps fine details sharp without aliasing; enlarging uses bilinear interpolation. Output format=jpeg with quality (1–100, default 82) to reduce size; transparent areas are flattened on the background colour. Headers report the new size and the input / output byte counts.
Images up to 25 megapixels and the file size of your plan are accepted; everything runs in memory and nothing is stored.
Use this in your code
curl -X POST "https://apibox.io.vn/v1/image-resize?width=400&height=400&fit=cover&format=jpeg" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "0=@./my-file" \
-o outputconst form = new FormData();
form.append('0', fileInput.files[0]);
const res = await fetch('https://apibox.io.vn/v1/image-resize?width=400&height=400&fit=cover&format=jpeg', {
method: 'POST',
headers: { Authorization: 'Bearer YOUR_API_KEY' },
body: form,
});
console.log(await res.json());import requests
res = requests.post(
"https://apibox.io.vn/v1/image-resize?width=400&height=400&fit=cover&format=jpeg",
headers={"Authorization": "Bearer YOUR_API_KEY"},
files={"0": open("my-file", "rb")},
timeout=30,
)
open("output", "wb").write(res.content)<?php
$ch = curl_init('https://apibox.io.vn/v1/image-resize?width=400&height=400&fit=cover&format=jpeg');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
CURLOPT_POSTFIELDS => ['0' => new CURLFile('my-file')],
]);
$response = curl_exec($ch);
file_put_contents('output', $response);API documentation → Get a free API key
FAQ
Is EXIF orientation applied?
Not automatically; use rotate= when a photo appears sideways (image-metadata tells you the EXIF orientation).
Is WebP supported?
Not yet: PNG and JPEG in and out.
What is the size limit?
25 megapixels and the file size of your plan (5–50 MB).