Free plan

Resize in cm / inches

Set a picture to a print size in centimetres or inches
POST
/v1/images/resize-physical

About this tool

This tool sets a picture to a real size on paper, such as 10 x 15 cm, in centimetres, millimetres, inches or points. You can also pick a ready size such as A4 or a photo size. The picture can be cropped, fitted with a border, or stretched to match. The tool also tells you if the picture is too small to print sharply at that size.
For example, you prepare a photo for a 10 x 15 cm print at the photo shop.

How to use it

  1. Choose this tool.
  2. Add your pictures with Upload or drag and drop.
  3. Choose a ready size, or type a width and height and pick the unit.
  4. Choose how the picture fits (crop, border or stretch) and where it is cut.
  5. Press Generate, then download the pictures.

What you get back

You get new pictures with the print size saved inside, plus a note about how sharp each one will look at that size.
GOOD TO KNOW
The resolution is the dpi parameter of the output options (default 300 for this tool). A result larger than 100 megapixels is refused. Counts as one image per picture.
TEST IT LIVE

Try Resize in cm / inches 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/resize-physical
Tool ID
images.resize-physical
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-physical" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'images=@photo.jpg' \
  -F 'width=10' \
  -F 'height=15' \
  -F 'unit=cm'

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.resizePhysical({
    "images": 'photo.jpg',
    "width": "10",
    "height": "15",
    "unit": "cm"
  });
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()->resizePhysical([
    'images' => 'photo.jpg',
    'width' => '10',
    'height' => '15',
    'unit' => 'cm',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Make a picture the physical size you want: a width and a height in centimetres, millimetres, inches or points at a resolution (dpi), or a paper or photo size such as A4 or 10 x 15 cm. The picture is cropped, fitted or stretched, the dpi is written into the file, and the answer says what resolution the source really has at that size.

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

Resize in cm / inches is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/images/resize-physical 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.