Resize in cm / inches
About this tool
How to use it
- Choose this tool.
- Add your pictures with Upload or drag and drop.
- Choose a ready size, or type a width and height and pick the unit.
- Choose how the picture fits (crop, border or stretch) and where it is cut.
- Press Generate, then download the pictures.
What you get back
Try Resize in cm / inches in the Studio
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;