How to Fix a Blurry or Angled Photo Before OCR

You photograph a page, run it through OCR, and the result is nonsense. Words come back as near-misses, numbers are wrong, and half of it needs retyping anyway. The instinct is to blame the recognition. Usually the problem is earlier than that: the picture you handed it was hard to read, and no recogniser can invent detail that was never captured.

This guide covers what actually goes wrong in a photographed page, and the three corrections that fix most of it before recognition ever runs.

Why a photo is harder than a screenshot

A screenshot is already perfect. The letters were drawn by the computer, so every stroke is crisp, the background is uniform, and the lines are exactly horizontal. Recognition on a screenshot is close to solved.

A photo of a page has none of those guarantees. The paper is lit unevenly, often brighter on one side than the other. The camera was held at a slight angle, so the rectangle of the page arrives as a lopsided quadrilateral and the lines of text fan outwards. Focus may be soft. There may be a shadow from your own hand. Each of these on its own is survivable; together they are what turns a clean paragraph into a garbled one.

The good news is that all three of the big ones are correctable, and correcting them is far quicker than proofreading a bad result.

Correction one: make the text stand out from the paper

Recognition works by finding the boundary between ink and background. When a photo is underexposed, that boundary is a smudge of similar greys and the recogniser has to guess. When it is overexposed, thin strokes disappear into white and letters lose the details that distinguish them.

Two controls handle almost all of this. Brightness moves the whole image lighter or darker, which rescues a shot taken in poor light. Contrast pushes light and dark further apart, which is the one that matters most for text: it darkens the ink and lightens the paper, sharpening exactly the boundary the recogniser is looking for.

A practical order of operations: fix brightness first so the page looks roughly like paper rather than grey, then raise contrast until the letters look solid without the thin strokes breaking up. If you push contrast too far the ink starts to fragment and accuracy drops again, so stop as soon as the text looks clean.

Correction two: straighten the page

Most tools will quietly correct a small tilt for you. What they cannot correct is perspective, which is a different problem. Tilt means the page is rotated in the plane of the image. Perspective means the page was photographed from an angle, so the far edge is genuinely narrower than the near edge and the lines of text converge slightly as they recede.

To a recogniser this is disastrous in a specific way: it expects a line of text to be a straight horizontal run of similar-sized letters. In a perspective-distorted photo the letters change size across the line and the baseline curves. Words at the far edge suffer most, which is why the errors in a photographed page are so often clustered on one side.

The fix is to tell the tool where the four corners of the page are, and let it flatten that quadrilateral back into a rectangle. This is the single most effective correction for a photo taken at a desk, and it is worth doing before you touch brightness or contrast, because flattening changes what the rest of the image looks like.

Correction three: get the orientation right

This one sounds trivial and is surprisingly common. A page photographed in landscape and then read in portrait, or a receipt captured sideways, produces output that looks like random characters. Recognisers do try to detect orientation, but detection needs enough text to be confident, and a short receipt or a caption often does not provide it.

If a result comes back as complete gibberish rather than as near-misses, rotation is the first thing to check. Gibberish and near-misses are different symptoms with different causes. Near-misses mean the recogniser found the text and struggled with the detail. Gibberish usually means it was not looking at text the way it expected to see it at all.

Shooting a better photo in the first place

Corrections are a rescue, not a substitute. A few habits at capture time save all of it:

  1. Get directly above the page rather than leaning over it from one side. This is what removes perspective distortion at the source.
  2. Put the page near a window or under an even light, and keep your own shadow off it. Side lighting creates a bright half and a dark half that no single brightness setting fixes.
  3. Fill the frame with the page. Cropping later throws away resolution you needed.
  4. Tap to focus before shooting, and take a second shot. Soft focus is the one problem no correction recovers, because the detail genuinely is not there.

Doing it in the browser

These corrections do not require photo-editing software. In Textquill, a captured image can be adjusted for brightness and contrast, rotated, and flattened by dragging the four corners of the page, and the scan is then run again on the corrected picture. All of it happens on your own machine, so a photograph of a contract or a medical letter is never uploaded anywhere to be fixed.

The workflow that works: scan once to see what you get, and if the result is poor, look at the picture rather than the text. Flatten the page if it was shot at an angle, raise the contrast if the ink looks washed out, and scan again. Two passes on a corrected image beat proofreading a bad result almost every time.

When the picture is not the problem

If a corrected, well-lit, straight-on photo still reads badly, the cause is usually one of three other things. The recognition language may be set wrong, which produces confident nonsense in the wrong alphabet. The text may be handwritten, which is a genuinely harder problem than printed type. Or the type may be decorative rather than plain, and stylised lettering defeats recognition in a way no amount of contrast will fix.

Knowing which of those you are looking at saves a lot of pointless fiddling with sliders.

Try it yourself

Textquill extracts text from any image right in your browser — private, offline, and on your device.

Add Textquill to Chrome