Image Resize API

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"
}

Flexible Resize Options

Exact Dimensions

Set specific width and height in pixels. Perfect for fixed-size thumbnails.

width=800&height=600

Scale by Percentage

Scale images up or down by percentage while maintaining aspect ratio.

scale=50

Width or Height Only

Set one dimension, let the other adjust automatically to maintain ratio.

width=1200

Fit Modes

Contain

Fit inside dimensions, maintain aspect ratio

fit=contain

Cover

Fill dimensions, crop if needed

fit=cover

Fill

Stretch to exact dimensions

fit=fill

Inside

Never upscale, only shrink

fit=inside

Supported Image Formats

PNG JPG/JPEG WebP GIF TIFF BMP

Common Use Cases

Thumbnail Generation

Generate consistent thumbnails for galleries, listings, and previews.

Responsive Images

Create multiple sizes for srcset and responsive web design.

E-commerce

Standardize product images across your catalog.

Profile Pictures

Resize and crop user uploads to consistent avatar sizes.

Social Media

Generate platform-specific sizes for Facebook, Twitter, Instagram.

Email Marketing

Optimize images for email newsletters and campaigns.

Code Examples

Python - Generate Thumbnails

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"]

JavaScript - Responsive Sizes

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);
}

Simple, Transparent Pricing

$0.005
per image resized
  • 50 free resizes to start
  • All image formats supported
  • Multiple fit modes
  • Quality preservation
  • Batch processing available
Get Started Free

Start Resizing Images

Fast, flexible image resizing with one API call. Try free today.

Get Your Free API Key