Resize Images to Any Dimension via API
Resize images to exact pixel dimensions via REST API. Specify width, height, fit mode (cover, contain, fill), and output format as multipart/form-data. Perfect for thumbnails, avatars, and responsive image pipelines.
# Resize an image to specific dimensions
curl -X POST \
https://api.convertfilefast.com/v2/image/resize \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@photo.jpg" \
-F "width=800" \
-F "height=600" \
-F "fit=cover" \
-F "format=jpeg" \
--output resized.jpg
# HTTP 200 OK — Content-Type: image/jpeg
# fit options: cover, contain, fill, inside, outsideAdvantages
Why use our API?
Complete and reliable solution for integration in any tech stack.
Exact Dimensions
Specify precise width and height in pixels. Get pixel-perfect output every time regardless of the source image size.
Flexible Fit Modes
Choose from cover, contain, fill, inside, or outside fit modes to control how the image fills the target dimensions.
Format Conversion
Resize and convert format simultaneously. Output as JPEG, PNG, or WebP with a single API call.
Thumbnail Generation
Generate thumbnails, avatars, and product image variants at scale. Automate image resizing in content pipelines.
n8n Workflow Support
Resize images in n8n workflows triggered by file uploads, webhooks, or scheduled tasks. No extra tools needed.
Zero Storage
Images are processed in memory and deleted immediately. Your originals and resized outputs are never stored.
FAQ
Frequently Asked Questions
How do I resize images via the API?
Send a POST request to https://api.convertfilefast.com/v2/image/resize with your image as a multipart/form-data upload. Include the width and height fields (in pixels) and an optional fit parameter (cover, contain, fill, inside, or outside). The API returns the resized image as a binary stream. See the cURL and Python examples above for ready-to-run code.
What image formats are supported for resizing?
The API supports JPEG, PNG, WebP, AVIF, GIF, BMP, TIFF, and HEIC as input formats. You can also specify an output format (jpeg, png, webp) via the format parameter to convert and resize in a single request.
Can I preserve aspect ratio or fit images to specific dimensions?
Yes. Use the fit parameter to control how the image fills the target dimensions. cover crops the image to fill the box, contain fits the image inside without cropping, fill stretches to exact dimensions, inside resizes so both dimensions fit within the box, and outside resizes so at least one dimension exceeds the box. All modes preserve your target width and height.
How does the API handle image quality and compression?
Pass a quality parameter (integer from 1 to 100) to control output compression for JPEG and WebP. The default is 85, which balances file size and visual quality well for most use cases. For PNG, lossless compression is used regardless of the quality setting. AVIF uses adaptive compression automatically.
What are the file size limits for image resizing?
The free plan supports image files up to 5 MB per request. Paid tiers support larger files and higher throughput. See /docs for the complete limit table by plan.
Can I integrate image resizing in n8n, Zapier, or batch pipelines?
Yes. The image resize endpoint is a standard REST API compatible with any HTTP client. Use it in n8n HTTP Request nodes, Zapier webhooks, Make (Integromat), and Power Automate. For batch processing, loop over your image URLs or file paths and call the endpoint for each one. See the n8n example tab above for a ready-to-import node configuration.
Related Tools
Start Resizing Images via API
Get your API key and resize images to any dimension in seconds. Free plan includes 10 conversions per month.
No credit card. 10 free conversions on Free plan.