Skip to content

Straighten scan

Detect the tilt of a scanned page and rotate it level.

Updated

Add your files

images, JPG, JPEG, PNG, WEBP and more

You can also paste a screenshot with Ctrl+V

How to straighten a scan

  1. 1

    Add one or more scanned or photographed pages. Each is measured and turned on its own.

  2. 2

    Set the Maximum correction, 1 to 45 degrees with 12 as the default: the tilt is searched within that range, so keep it small for pages that are only slightly off.

  3. 3

    Press Straighten scan and download the copies, named with "-straight" added. The result lists the correction applied to each page.

  • Use Rotate & flip image when you know the angle, or the page needs a quarter turn: it turns by any angle you choose.
  • Use Enhance scan when the page should also be whitened and sharpened: it straightens with the same measurement and cleans the page in one run.

How far the search goes

Maximum correction is the range of angles tried, in half-degree steps either way: 49 angles at the default of 12 degrees, 181 at 45. A small range is right for a flatbed scan that is a degree or two off, and it limits how far a page with little text can be turned by a wrong estimate, because the best-scoring angle is always applied. A photo taken at a clear slant needs a wider range.

Many pages, large pictures and the server step

Every page in the run is measured separately, each named with "-straight" added. A picture larger than this browser can hold is scaled down to the largest size that works, and the result says so; an animated GIF or WebP keeps only its first frame, with a note. The measurement and the turn run in your browser, except that a picture your browser cannot open itself, such as most TIFF files, is decoded on our server first and deleted as soon as it is returned. iPhone HEIC photos are not sent there, because the server cannot read them either.

Questions about Straighten scan

How is the tilt found?

From the lines of text. A copy of the page no wider than 600 pixels is made, its dark pixels are marked, and for every angle from minus the Maximum correction to plus it, in half-degree steps, those pixels are projected onto rows; the angle at which the rows separate most sharply into text and gaps is the tilt. The measurement relies on lines of text, so a photograph or a drawing can be given an arbitrary turn.

Why does it say the pages were already straight?

When no page measured 0.3 degrees of tilt or more, which with half-degree steps means no tilt was found, the result says so and the copies are the same picture encoded again. Raise the Maximum correction if a page is visibly crooked by more than the range you set.

What about the corners and the file type?

The turned page is placed on a white canvas just large enough to hold it, so the corners are white and the picture grows a little: a 2 degree turn adds about 3.5% of the height to the width. A PNG is saved as PNG; every other format is saved as a JPG at 92% quality. The picture is rebuilt from its pixels, so metadata such as camera details is not in the output.

Advertisement