xtract.bot

Deskew (auto-straighten)

Try it interactively →
POST /api/image-deskew

Auto-deskew a scanned document. Detects the rotation angle (up to ±15°) and rotates the image so text lines are horizontal. Useful before OCR.

Detects the rotation angle of a scanned document (up to ±15°) and rotates it so the text lines are horizontal. Useful before feeding scans into `document-ocr`. The detection is based on edge analysis, so it works best on text-heavy documents. Photos and screenshots may not have a meaningful skew angle to detect.

Inputs

NameTypeDefaultDescription
image*fileInput image bytes.
backgroundstring"white"Background fill colour for rotated regions outside the original (CSS-style hex or named: white, black, transparent).
maxAnglenumber (0…90)45Cap rotation magnitude — angles outside ±maxAngle are rejected (likely false positives).

Response

Modes: binary, json. Cache: yes (24h TTL).