Image Resizer API avatar
Image Resizer API

Pricing

Pay per event

Go to Apify Store
Image Resizer API

Image Resizer API

Professional image resizer API for automated batch image processing. Resize images to any dimensions with smart cropping, format conversion (JPEG, PNG, WebP, TIFF), and quality optimization. Perfect for web optimization, e-commerce thumbnails, social media content, and responsive design.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Sachin Kumar Yadav

Sachin Kumar Yadav

Maintained by Community

Actor stats

0

Bookmarked

4

Total users

1

Monthly active users

3 days ago

Last modified

Share

Image Resizer API - Batch Image Processing & Smart Cropping

Professional Image Resizer API for automated batch image processing. Resize images to any dimensions with smart cropping, format conversion, and quality optimization. Perfect for web optimization, e-commerce, social media, and responsive design.

Features

Multiple Image Formats: Supports JPEG, PNG, WebP, TIFF
Batch Processing: Handle multiple images simultaneously
Smart Cropping: Intelligent face/subject detection using entropy analysis
Flexible Resizing: Multiple fit modes (cover, contain, fill, inside, outside)
Format Conversion: Convert between different image formats
Quality Control: Customizable compression settings
Multiple Input Sources: URLs, Base64, or Key-Value Store

Pricing Model

This Actor uses Pay-per-Event pricing:

EventCostDescription
ACTOR_START$0.01Charged once when Actor starts
ACTOR_PROCESSING$0.005Charged for each image processed
ACTOR_COMPLETE$0.005Charged once when Actor completes

Example Cost Calculation:

  • Processing 10 images = $0.01 (start) + $0.05 (10 × processing) + $0.005 (complete) = $0.065

Input Configuration

Required Fields

  • images: Array of image objects with one of:
    • url: Direct image URL
    • base64: Base64 encoded image data
    • keyValueStoreKey: Key from Apify Key-Value Store

Optional Fields

  • width: Target width in pixels (1-10000)
  • height: Target height in pixels (1-10000)
  • fit: Resize mode
    • cover: Crop to fill dimensions (default)
    • contain: Fit within dimensions with letterboxing
    • fill: Stretch to exact dimensions
    • inside: Resize to fit inside dimensions
    • outside: Resize to fit outside dimensions
  • position: Crop position for 'cover' mode
    • smart: Intelligent face/subject detection
    • center, top, bottom, left, right
  • format: Output format (jpeg, png, webp, tiff)
  • quality: 1-100 (default: 80)
  • backgroundColor: RGBA color for letterboxing
  • outputFolder: Folder name in Key-Value Store (default: "resized-images")

Example Input

{
"images": [
{
"url": "https://example.com/image1.jpg"
},
{
"url": "https://example.com/image2.png",
"filename": "custom-name"
}
],
"width": 800,
"height": 600,
"fit": "cover",
"position": "smart",
"format": "webp",
"quality": 85
}

Output

Results are saved to the Dataset with:

{
"summary": {
"totalImages": 2,
"processedSuccessfully": 2,
"errors": 0,
"successRate": "100.00%"
},
"results": [
{
"success": true,
"originalFilename": "image1.jpg",
"outputFilename": "resized-images/image1_800x600.webp",
"publicUrl": "https://api.apify.com/v2/key-value-stores/.../records/...",
"originalSize": {
"width": 1920,
"height": 1080,
"format": "jpeg",
"bytes": 245678
},
"outputSize": {
"width": 800,
"height": 600,
"format": "webp",
"bytes": 45230
},
"compressionRatio": "81.58%"
}
]
}

Use Cases

🌐 Web Development

Optimize images for responsive websites with multiple breakpoints

🛒 E-commerce

Generate product thumbnails and multiple size variants

📱 Social Media

Resize images for different platform requirements (Instagram, Facebook, Twitter)

📰 Content Management

Batch process uploaded images for blogs and news sites

📲 Mobile Apps

Create app icons and assets in various sizes

API Integration

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('YOUR_USERNAME/image-resize-api').call({
images: [
{ url: 'https://example.com/image.jpg' }
],
width: 800,
height: 600,
fit: 'cover',
format: 'webp',
quality: 85
});
const dataset = await client.dataset(run.defaultDatasetId).listItems();
console.log(dataset.items[0]);

Smart Cropping

When using "position": "smart", the Actor uses advanced algorithms to detect:

  • 👤 Faces
  • 🎯 Areas of interest (high contrast/detail)
  • 📐 Composition balance

This ensures important subjects stay in frame when cropping.

Performance Tips

  1. Batch Processing: Group multiple images in one run to minimize startup costs
  2. WebP Format: Best compression ratio for web use
  3. Quality Setting: 80-85 is optimal for most use cases
  4. Smart Cropping: Only use when needed (adds processing time)

Support

For issues or questions:

License

Apache-2.0