By · Updated

Document Scanner Online

Scan a Document From a Photo With Perspective Correction and Black and White

No ratings yet

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the Document Scanner works

This document scanner online tool flattens a photo of a page. Photograph a letter, receipt or whiteboard at whatever angle you can manage, drop the photo here, and the page is found, pulled square and cropped to its edges as if it had gone through a flatbed scanner. Choose colour, greyscale or a crisp black and white scan, and download the result. The photo is processed in your browser and never uploaded.

Document scanner online: getting a good result

A photo of a document is almost never a rectangle. The camera sits at an angle, so the page comes out as a trapezoid, and the desk or table fills the rest of the frame. A scanner app fixes this with a perspective transform: it finds the four corners of the page in the photo and computes the mapping that would put those corners at the corners of a true rectangle, then re-samples every pixel through that mapping. The result looks as though the camera had been directly above the page.

Finding the corners is the hard part, and this tool does it the way most scanner apps do. The photo is converted to greyscale, blurred slightly, and run through an edge detector. The edges are thickened so small gaps close, and the outlines of every enclosed shape are traced. Each outline is simplified to a polygon; the largest one with exactly four corners that covers at least five percent of the frame is taken to be the page. Edge sensitivity sets the detector's threshold: a low value picks up faint edges, which helps when the page and background are similar in tone but can also pick up creases and shadows; a high value keeps only strong edges. If no four-cornered shape is found, the stats say so and the photo is shown uncorrected; changing the sensitivity or retaking the photo on a darker, plainer background usually fixes it.

The output size comes from the longest edges of the detected quadrilateral, so a page photographed close up produces a large scan and one photographed from across the room a small one. Output chooses the finish. Colour keeps the photo as it is. Greyscale drops the colour, which is the usual choice for text. Black and white applies an adaptive threshold that decides for each small neighbourhood whether a pixel is ink or paper, which evens out uneven lighting and produces the clean, high-contrast look of a real scan; it is saved as a PNG because JPEG smears sharp black and white edges. Very large photos are scaled to 2400 pixels on the long side first, and the whole process runs locally in the page.

FAQ

Why was the page not found?

Usually the page and the surface are too similar in tone, or a corner is out of frame. Lower the edge sensitivity, or retake the photo on a darker, plainer background with all four corners visible and no hand in the way.

Why does the scan look stretched?

The output size is taken from the longest edges of the detected shape, so a page shot at a steep angle can come out slightly off-proportion. Photograph it closer to straight-on, or resize the result to A4 or Letter proportions afterwards.

Which output should I use for a receipt?

Black and white. The adaptive threshold evens out the lighting and makes faint thermal print readable, and the PNG keeps the edges crisp for OCR.

Can it scan several pages into one PDF?

No, one photo to one image. Scan each page, then combine the images with the PNG to PDF tool, which puts each image on its own page in order.

See also: all Images tools, Audio, Video & Screen, PDF, SVG, Simulations & Screensavers, Generative Art, Chart Makers, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.

Related tools