Resize, scale, and transform images programmatically. Set exact dimensions, scale by percentage, or fit to containers. Perfect for thumbnails, responsive images, and batch processing.
$0.005 per image • Maintains quality • All formats supported
curl -X POST "https://api.chargedapi.com/image/resize" \
-H "X-API-Key: your_api_key" \
-F "file=@photo.jpg" \
-F "width=800" \
-F "height=600" \
-F "fit=contain"
# Response:
{
"success": true,
"download_url": "https://...",
"width": 800,
"height": 600,
"format": "jpg"
}
Set specific width and height in pixels. Perfect for fixed-size thumbnails.
width=800&height=600
Scale images up or down by percentage while maintaining aspect ratio.
scale=50
Set one dimension, let the other adjust automatically to maintain ratio.
width=1200
Fit inside dimensions, maintain aspect ratio
fit=contain
Fill dimensions, crop if needed
fit=cover
Stretch to exact dimensions
fit=fill
Never upscale, only shrink
fit=inside
Generate consistent thumbnails for galleries, listings, and previews.
Create multiple sizes for srcset and responsive web design.
Standardize product images across your catalog.
Resize and crop user uploads to consistent avatar sizes.
Generate platform-specific sizes for Facebook, Twitter, Instagram.
Optimize images for email newsletters and campaigns.
import requests
def create_thumbnail(image_path, size=200):
with open(image_path, "rb") as f:
response = requests.post(
"https://api.chargedapi.com/image/resize",
headers={"X-API-Key": "your_api_key"},
files={"file": f},
data={
"width": size,
"height": size,
"fit": "cover"
}
)
return response.json()["download_url"]
const sizes = [320, 640, 1024, 1920];
async function generateResponsive(file) {
const urls = await Promise.all(
sizes.map(width =>
fetch(`https://api.chargedapi.com/image/resize`, {
method: "POST",
headers: { "X-API-Key": "your_api_key" },
body: createFormData(file, { width })
}).then(r => r.json())
)
);
return urls.map(r => r.download_url);
}
Fast, flexible image resizing with one API call. Try free today.
Get Your Free API Key