Change image aspect ratio avatar

Change image aspect ratio

Pricing

from $0.00005 / actor start

Go to Apify Store
Change image aspect ratio

Change image aspect ratio

Transform any image to your desired aspect ratio (square, widescreen, portrait, custom) with intelligent background filling and quality preservation. Supports multiple image formats and batch processing.

Pricing

from $0.00005 / actor start

Rating

5.0

(1)

Developer

Akash Kumar Naik

Akash Kumar Naik

Maintained by Community

Actor stats

1

Bookmarked

15

Total users

1

Monthly active users

8 days ago

Last modified

Security

Limited permissions

Share

Frame Image Converter is an Apify Actor that converts any image to your target aspect ratio with professional-grade processing — smart background fill, three resize modes, and PNG/JPEG/WebP output. Point it at a direct image URL or a cloud storage link (Google Drive, Dropbox, OneDrive, GitHub) and get a perfectly framed image back, charged at $0.005 per successfully converted image.

What Is Frame Image Converter?

Frame Image Converter is a cloud-based aspect ratio conversion API built on Python 3.12 with Pillow. It resizes any image to a target aspect ratio while maintaining quality and visual appeal: choose how the image fills the frame (fit/pad, fill/crop, or stretch) and what fills the leftover space (white, black, transparent, or a blurred version of the original). Every conversion returns full metadata — dimensions, formats, sizes, compression ratio, and processing time.

Key Features

  • 7 aspect ratio presets — 1:1, 4:3, 3:4, 16:9, 9:16, 4:5, 21:9
  • Smart Background Fill — white, black, transparent (PNG only), or blurred original
  • Three Resize Modes — Fit (pad), Fill (crop), Stretch
  • Output Formats — PNG, JPEG, WEBP
  • Cloud Storage Support — Google Drive, Dropbox, OneDrive, GitHub links, plus any direct URL
  • Quality Processing — Pillow with LANCZOS resampling for maximum quality
  • Resilient Downloads — configurable retry logic with exponential backoff
  • Transparent Billing — pay-per-event; no charge for failed images

Supported Image Sources

PlatformSupported URL Format
Google Drive/file/d/FILE_ID/view share links
Dropboxdropbox.com/s/... share links
OneDriveonedrive.live.com and 1drv.ms links
GitHub/blob/ URLs (auto-converted to raw)
Direct URLsAny publicly accessible image URL

Use Cases

  • Social media — square posts (1:1), portrait posts (4:5), Reels/TikTok frames (9:16)
  • Video & web — YouTube thumbnails and banners (16:9), ultrawide cinematic banners (21:9)
  • Photography — standard (4:3) and portrait (3:4) framing for print and portfolios
  • Product imagery — normalize marketplace images to one consistent ratio
  • Automation pipelines — normalize user-uploaded images via the Apify API

Input Parameters

ParameterTypeRequiredDefaultDescription
imageUrlstringYes—URL of the image to process (direct links or cloud storage URLs)
aspectRatiostringNo1:1Target ratio: 1:1, 4:3, 3:4, 16:9, 9:16, 4:5, 21:9
backgroundColorstringNowhiteBackground fill for fit mode: white, black, blur, transparent (PNG only)
resizeModestringNofitfit (pad with background), fill (crop to fill), stretch (distort to fill)
outputFormatstringNoPNGPNG (lossless, supports transparency), JPEG (smallest), WEBP (best compression)

Aspect Ratio Presets

RatioUse Case
1:1Instagram feed, profile photos, product thumbnails
4:3Presentations, classic TV, standard photography
3:4Portrait standard
16:9YouTube thumbnails, HD video, website banners
9:16Instagram Reels, TikTok, Stories
4:5Instagram portrait posts
21:9Ultrawide cinematic banners

Background Modes

ModeDescription
whiteClean white background (default)
blackSolid black background
transparentTransparent fill — PNG output only
blurBlurred version of the original image as background (artistic effect)

Resize Modes

ModeBehaviour
fitScales image to fit within the target frame; pads remaining space with background
fillCrops the image to fill the entire target frame (center crop)
stretchStretches/distorts the image to exactly fill the target dimensions

Example input:

{
"imageUrl": "https://example.com/photo.jpg",
"aspectRatio": "16:9",
"backgroundColor": "white",
"resizeMode": "fit",
"outputFormat": "PNG"
}

Sample Output

{
"index": 0,
"originalUrl": "https://example.com/photo.jpg",
"processedUrl": "https://api.apify.com/v2/key-value-stores/.../photo.png",
"filename": "photo.png",
"processedKey": "processed-photo.png",
"success": true,
"aspectRatio": "16:9",
"originalDimensions": { "width": 800, "height": 600 },
"finalDimensions": { "width": 1066, "height": 600 },
"originalFormat": "JPEG",
"outputFormat": "PNG",
"compressionRatio": 1.4,
"processingTime": 0.4,
"totalProcessingTime": 1.2,
"backgroundType": "white",
"resizeMode": "fit",
"timestamp": "2026-05-18T12:00:00.000Z"
}

Each processed image produces one dataset record with the source and output dimensions, formats, file sizes, compression ratio, timing, background type, and resize mode used. Converted image files are stored in the key-value store; processedUrl is the direct public link.

How to Use the Frame Image Converter

  1. Open the Actor page on Apify Store and click Start Actor.
  2. Paste your image URL into imageUrl (direct link or Google Drive/Dropbox/OneDrive/GitHub share URL).
  3. Choose your Aspect Ratio, Background, Resize Mode, and Output Format.
  4. Click Start — grab processedUrl from the Dataset tab when the run finishes.

Connect via API

cURL:

curl -X POST "https://api.apify.com/v2/acts/akash9078/frame-image-converter/runs" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"imageUrl":"https://example.com/photo.jpg","aspectRatio":"16:9","resizeMode":"fit","outputFormat":"PNG"}'

Python:

import requests
response = requests.post(
"https://api.apify.com/v2/acts/akash9078/frame-image-converter/runs",
headers={"Authorization": "Bearer YOUR_API_TOKEN"},
json={"imageUrl": "https://example.com/photo.jpg", "aspectRatio": "16:9", "resizeMode": "fit", "outputFormat": "PNG"},
)
print(response.json())

Node.js with the Apify Client:

const { ApifyClient } = require('apify-client');
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('akash9078/frame-image-converter').call({
imageUrl: 'https://example.com/photo.jpg',
aspectRatio: '16:9',
resizeMode: 'fit',
outputFormat: 'PNG',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Frame Image Converter Pricing

This actor uses Apify's Pay Per Event model. You are only charged for results you actually receive — no charge for failed images.

EventPriceWhen
image-processed-success$0.005 per imageCharged once per image successfully downloaded, converted, and stored

Example: Processing 100 images costs $0.50. Failed images are never charged.

This model is transparent, predictable, and fair — you pay only for value delivered. Learn more about Apify Pay Per Event.

Why Use This Instead of Manual Cropping?

CapabilityFrame Image ConverterManual editing
Aspect presets7 ratios, one click eachManual canvas setup
Smart fillBlur/transparent/white/black paddingManual masking
Cloud linksDrive/Dropbox/OneDrive/GitHub auto-handledManual download
MetadataDimensions, sizes, compression ratio per imageNone
API & automationRuns, schedules, webhooksNot available

Limitations

  • Processes one image per run (single imageUrl input)
  • Aspect ratio is limited to the 7 supported presets
  • Transparent background requires PNG output — JPEG does not support transparency
  • Cloud storage URLs must be publicly accessible share links; private files need a public share link first
  • Memory: 128 MB minimum, 256 MB maximum

Technical Architecture

  • Runtime: Python 3.12 on apify/actor-python:3.12
  • Image Engine: Pillow (PIL) with LANCZOS resampling for maximum quality
  • HTTP Client: aiohttp with streaming downloads, DNS caching, and connection pooling
  • Concurrency: asyncio-based controlled processing
  • Retry: Custom exponential backoff for resilient downloads
  • Billing: Apify Pay Per Event — charged only on successful image processing

FAQ

Why Pay Per Event instead of compute-based pricing?

PPE is fairer and more predictable. You pay $0.005 per successfully converted image — no charge for failures, no surprise bills from idle compute time.

What happens if an image fails to download?

The actor retries with exponential backoff. If all retries fail, the failure is recorded in the dataset with an error message and no charge is applied.

Can I process images from private cloud storage?

Cloud storage URLs must be publicly accessible share links. Private files require you to generate a public share link first.

Does transparent background work with JPEG?

No — JPEG does not support transparency. Use PNG or WEBP output format when selecting the transparent background option.

How do I get the processed images?

Each dataset record contains a processedUrl field — a direct public link to the converted image stored in the actor's key-value store.

What is the maximum image size?

Downloads are streamed with a configurable size guard within the 128-256 MB memory limits; oversized sources are the most common cause of skipped images.

If you need more image conversion tools from Apify, check out my other Apify Actors:


Built and maintained by akash9078 on the Apify platform.