Free plan
Generate Variants
Make several named versions of one picture at once
About this tool
This tool makes several different versions of one picture in one go. You define each version with a name and its own size or settings, for example small, medium and large. You can also apply a common edit to the source first. It takes one picture and up to 10 versions. This is useful when a website needs a different size for each screen.
For example, you create a thumbnail, a mobile version and a desktop version of the same photo.
How to use it
- Choose this tool.
- Add one picture with Upload or drag and drop.
- Add each version you need and give it a name and a size.
- Add a common edit for all versions if you want one.
- Press Generate, then download the versions.
What you get back
You get one new picture for each version, named as you chose. Download them one by one or as a ZIP if offered.
GOOD TO KNOW
More than one uploaded file -> 400. Each variant is derived independently from the (optionally preprocessed) source, so order never matters.
TEST IT LIVE
Try Generate Variants 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/variants
Tool ID
images.variants
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/variants" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'images=@photo.jpg' \
-F 'variants=[{"name":"x"}]' \
-F 'output_bundle=zip' \
-F 'response=url'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.variants({
"images": 'photo.jpg',
"variants": [
{
"name": "x"
}
],
"output_bundle": "zip",
"response": "url"
});
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()->variants([
'images' => 'photo.jpg',
'variants' => [[
'name' => 'x',
]],
'output_bundle' => 'zip',
'response' => 'url',
]);
echo $result->requestId;More in Images
