Free plan

Transform

Crop, resize, rotate, flip and adjust a picture in one go
POST
/v1/images/transform
Black and white
Original
OriginalBlack and white

About this tool

This tool does several everyday edits in one step. You can crop to an area, resize, rotate, flip, blur, sharpen, make it black and white or change brightness, contrast and colour strength. You can also add a border or padding. Only the options you fill in are used, and they are applied to every picture you add.
For example, you turn a sideways photo upright, crop it and make it a little brighter in one go.

How to use it

  1. Choose this tool.
  2. Add your pictures with Upload or drag and drop.
  3. Fill in only the edits you want, such as crop, resize, rotate or flip.
  4. Add any look changes, such as brightness, blur or black and white.
  5. Press Generate, then download the pictures.

What you get back

You get new pictures with all your edits applied, ready to download. Your originals are not changed.
GOOD TO KNOW
Operations run in a fixed order: crop, resize, rotate, flip, enhance, convolve, affine, channelExtract, noise, vignette, pixelate, posterize, duotone, emboss, edgeDetect, background, padding, border, colorSpace. The fields watermark, format, quality, targetSizeKB and keepMetadata are rejected (400 invalid_parameter). Dotted field names (crop.x, enhance.blur ...) are literal multipart field names.
TEST IT LIVE

Try Transform in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Images
Plan
Free
Method
POST
Endpoint
/v1/images/transform
Tool ID
images.transform
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/transform" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'images=@photo.jpg' \
  -F 'resize.width=1' \
  -F 'resize.height=1' \
  -F 'resize.fit=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.transform({
    "images": 'photo.jpg',
    "resize.width": 1,
    "resize.height": 1,
    "resize.fit": "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()->transform([
    'images' => 'photo.jpg',
    'resize.width' => 1,
    'resize.height' => 1,
    'resize.fit' => 'fit',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Crop, resize, rotate, flip and adjust a picture in one go. It can do several jobs from one endpoint: selector, flags, items.

Transform accepts JPEG, PNG, WEBP, GIF, AVIF, TIFF, SVG, SVGZ, BMP, ICO, APNG, PNM and 9 more. You can send several files in one request.

Transform is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/images/transform with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.