Free plan

Scan Cleanup

Make a photo of a page look like a clean scan
POST
/v1/images/scan-cleanup

About this tool

This tool cleans up a scan or a phone photo of a paper page. It straightens the tilted page, cuts away the border around it, evens out shadows and makes the paper white. You choose whether the result stays in colour, becomes grey, or turns pure black and white, which is best for text and gives the smallest file.
For example, you turn a phone photo of a signed contract on a table into a flat, white, readable page.

How to use it

  1. Choose this tool.
  2. Add your scans or photos with Upload or drag and drop.
  3. Choose colour, grey or black and white.
  4. Keep straighten, crop and whiten on, or switch off the ones you do not want.
  5. Press Generate, then download the pictures.

What you get back

You get cleaned pictures of your pages, ready to download. Your originals are not changed.
GOOD TO KNOW
Works on the real pixels: nothing is sent anywhere. A page with no text lines (a photo) is not turned. One picture counts as one image.
TEST IT LIVE

Try Scan Cleanup 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/scan-cleanup
Tool ID
images.scan-cleanup
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/scan-cleanup" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'images=@photo.jpg' \
  -F 'mode=gray' \
  -F 'margin=12' \
  -F 'max_angle=15'

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.scanCleanup({
    "images": 'photo.jpg',
    "mode": "gray",
    "margin": 12,
    "max_angle": 15
  });
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()->scanCleanup([
    'images' => 'photo.jpg',
    'mode' => 'gray',
    'margin' => 12,
    'max_angle' => 15,
]);
echo $result->requestId;
FAQ

Frequently asked questions

Make a scan or a photo of a page look like a clean document: straighten it, cut away the border, even out shadows and uneven light, make the paper white, and give it as colour, grey or pure black and white.

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

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

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