Free plan
Resize
Change the size of a picture to the width and height you want


About this tool
This tool makes a picture bigger or smaller. Give a width, a height, or both. You choose how the picture fits: keep the whole picture, fill the space and cut the edges, add a border, or stretch it. A picture is not made larger than it is unless you allow it. You can also cut away plain borders first and choose the file type of the result.
For example, you make a large photo 800 wide so it loads quickly on your website, keeping its shape.
How to use it
- Choose this tool.
- Add one or more pictures with Upload or drag and drop.
- Type the width, the height, or both.
- Choose how the picture should fit into that size.
- Press Generate, then download the pictures.
What you get back
You get new pictures at the size you asked for. Every picture you added is resized the same way.
GOOD TO KNOW
Applies width/height/fit to every uploaded image. `enlarge` defaults to an inferred value, so images are not upscaled unless you ask for a larger size.
TEST IT LIVE
Try Resize in the Studio
One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Family
Images
Plan
Free
Method
POST
Endpoint
/v1/images/resize
Tool ID
images.resize
Authentication
API key
Accepts
JPEG, PNG, WEBP, GIF, AVIF, TIFF +15 more
Background jobs
Yes
Usage group
Image
For developers
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/images/resize" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'images=@photo.jpg' \
-F 'width=800' \
-F 'height=600' \
-F 'resizeMode=fit'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.images.resize({
"images": 'photo.jpg',
"width": 800,
"height": 600,
"resizeMode": "fit"
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->images()->resize([
'images' => 'photo.jpg',
'width' => 800,
'height' => 600,
'resizeMode' => 'fit',
]);
echo $result->requestId;Documentation
Guides that use this tool
More in Images
