Free plan
Crop photos from a scan
Cut several photos from one scan into separate pictures
About this tool
Finds the photos lying on one scan (such as several prints on a scanner) and cuts each one out as its own straightened picture, in reading order. You can set the smallest size that counts as a photo, how many to cut out at most, the background colour of the scanner, and whether to straighten crooked photos.
For example, you scan eight old prints at once and get eight separate picture files.
How to use it
- Choose this tool.
- Add your scan with Upload or drag and drop.
- Check the options, such as the most photos to cut out and straightening.
- Press Generate.
- Download the separate photos.
What you get back
You get one new picture for each photo found, which you can download.
GOOD TO KNOW
Works on the real pixels. A scan with no photo gives an empty list and a hint. One scan counts as one image; each photo is an output.
TEST IT LIVE
Try Crop photos from a scan 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/crop-photos
Tool ID
images.crop-photos
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/crop-photos" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'images=@photo.jpg' \
-F 'min_area=2' \
-F 'tolerance=28' \
-F 'background=#f4f4f0'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.cropPhotos({
"images": 'photo.jpg',
"min_area": 2,
"tolerance": 28,
"background": "#f4f4f0"
});
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()->cropPhotos([
'images' => 'photo.jpg',
'min_area' => 2,
'tolerance' => 28,
'background' => '#f4f4f0',
]);
echo $result->requestId;