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, outsideimport requests
response = requests.post(
"https://api.convertfilefast.com/v2/image/resize",
headers={"Authorization": "Bearer YOUR_API_KEY"},
files={"file": open("photo.jpg", "rb")},
data={
"width": "800",
"height": "600",
"fit": "cover",
"format": "jpeg"
}
)
with open("resized.jpg", "wb") as f:
f.write(response.content)const formData = new FormData();
formData.append("file", fs.createReadStream("photo.jpg"));
formData.append("width", "800");
formData.append("height", "600");
formData.append("fit", "cover");
formData.append("format", "jpeg");
const response = await fetch(
"https://api.convertfilefast.com/v2/image/resize",
{
method: "POST",
headers: { "Authorization": "Bearer YOUR_API_KEY" },
body: formData,
}
);
fs.writeFileSync("resized.jpg", Buffer.from(await response.arrayBuffer()));// n8n HTTP Request Node — Resize Image
{
"method": "POST",
"url": "https://api.convertfilefast.com/v2/image/resize",
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{ "name": "file", "parameterType": "formBinaryData", "inputDataFieldName": "data" },
{ "name": "width", "value": "800" },
{ "name": "height", "value": "600" },
{ "name": "fit", "value": "cover" },
{ "name": "format", "value": "jpeg" }
]
},
"options": { "response": { "responseFormat": "file" } }
}Advantages
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.
How it works
4 steps to run this conversion
- 1
Create an API key
Sign up at convertfilefast.com/signup and copy your cff_ API key from the dashboard. The free tier includes 10 conversions per month.
- 2
POST the image to the endpoint
Send a multipart/form-data POST to https://api.convertfilefast.com/v2/image/resize with header X-API-Key: cff_your_key (Authorization: Bearer also works), the image as a file field or a public url field, and width and/or height, plus an optional fit of contain, cover or fill.
- 3
Receive the image
The response body is the resulting image, streamed back with a Content-Disposition filename. Save it or pass it straight to the next step of your pipeline — nothing is stored on our side.
- 4
Or invoke it from an AI agent
Add the MCP server to Claude, Cursor or any MCP-compatible client using https://mcp.convertfilefast.com/mcp, then call resize_image({ source_url: '...', width: 1200, fit: 'contain' }) as a single tool call — no HTTP client, no file handling.
Or call this from Claude, Cursor, or any MCP client
Convert File Fast ships a native Model Context Protocol server. Give this conversion to an AI agent as a single tool call — no HTTP client, no binary handling, per-user API keys.
npx -y convertfilefast-mcpresize_image({ source_url: "https://example.com/photo.jpg", width: 1200, fit: "contain" })Compared with
Convert File Fast vs alternatives
| Product | Native MCP | Free tier | Price |
|---|---|---|---|
| Convert File Fast | Yes | 10/month | $0.004/conv from $4 |
| Smallpdf | No | 2/day (unregistered) | $9/mo Pro |
| iLovePDF | No | Rate-limited | $7/mo Premium |
| Adobe Acrobat Online | No | Limited trials | $19.99/mo Acrobat Standard |
| CloudConvert | No | 25 conv-min | From $0.01/min |
Competitor pricing checked on 2026-07-16.
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?
Limits depend on your plan and are enforced per API key — the API reports the ceiling it currently accepts at https://api.convertfilefast.com/v1/info, and your own plan limit is shown in your dashboard.
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.