ToPDF

Perspective correction: how a tilted photo becomes a flat page

· How it works

Photograph a page from an angle and it renders as a trapezoid — the far edge shorter, text shrinking with distance. Scanners return a perfect rectangle anyway. The magic is 19th-century geometry running in milliseconds.

The homography, in one metaphor

Imagine the photo printed on a stretchy sheet. A homography is the precise recipe for pulling the sheet's four corners so the document's four corners land on a rectangle's four corners — everything between stretches consistently along. Mathematically it's a 3×3 matrix; practically it's “tell me where the four corners are, and I'll tell you where every pixel belongs”.

Why four corners suffice

A flat page photographed by a normal camera undergoes a projective transform, and projective transforms are fully determined by four point pairs. That's the deep reason corner accuracy matters so much — the corners aren't a crop hint, they're the coordinates of the math. A corner misplaced by a centimetre skews every line on the page, which is why the editor gives you a magnifier for exact placement.

What it can’t fix (and what happens after)

  • Curved paper: the math assumes a plane; a curled page is a cylinder — flatten before shooting. (How.)
  • Resolution isn't conjured: the far side of a steep shot was captured with fewer pixels; correction enlarges it but can't sharpen what wasn't sensed. Moderate angles keep quality even.

After the warp, ToPDF re-renders the page onto a fresh straight canvas and hands it to enhancement — your PDF page is the corrected document, not a tilted photo in a frame.

Frequently asked questions

Is quality lost by correcting?

The resampling is interpolated smoothly; at sane shooting angles the loss is imperceptible. The steeper the original angle, the more the far region must be enlarged — shoot square-ish for critical fine print.

Why do corrected pages sometimes have slightly non-square proportions?

The target rectangle’s aspect is estimated from the detected corners. Tiny estimation error changes proportions by a hair — invisible for reading, and re-cropping with adjusted corners refines it.

Scan it now — free & private

Snap a photo, get a clean auto-cropped PDF in seconds. Everything runs in your browser — your documents never leave your device.

Open the scanner

Related guides