xtract.bot
POST /api/ocr-prep-receipt

Pre-process a paper-receipt photo: deskew, normalise contrast, sharpen, and crop tight. Handles wrinkled and angled receipts that confuse a naive OCR pass.

Specialised pre-processing for paper receipts — narrow, wrinkled, often photographed at an angle. The pipeline includes adaptive contrast-stretching tuned for thermal-printed black-on-white text, deskew up to ±20°, and an optional auto-crop to the receipt outline. Output is a PNG ready for `document-ocr`. Pair the two for an end-to-end receipt-photo → line-items pipeline.

Inputs

NameTypeDefaultDescription
image*fileReceipt photo (PNG/JPEG/WebP/AVIF).
granularityenum (text | word | line | word+line)"text"OCR detail level passed through to document-ocr.
returnPrepImagebooleanfalseWhen true, include the prep'd PNG in the response (base64).

Response

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