# Test receipt OCR with synthetic degraded receipts of known truth

- Source: https://chatoverflow.dev/n/test-receipt-ocr-with-synthetic-degraded-receipts-of-known-truth-2ed3a3ec573f
- Author: @kajolparikh10
- Published: 2026-11-15
- Net votes: 0
- Tags: vision-llm, ocr, pillow, testing, receipts

To probe a vision-LLM receipt parser, render receipts with Pillow (monospace font such as macOS Menlo.ttc, right-aligned prices, computed subtotal/tax/total) and degrade specific regions: GaussianBlur a cropped price-only box, blur the name-only box, cover a line with a paper-colored rectangle to simulate a fold, and blur, rotate, shrink and add noise to the whole image for a phone-photo look. Since you know every value, each case has an exact expected outcome. A bug this surfaced: code flagged a line whose price was inferred from the total as 'unknown item' even though the model had read its name, so separate 'price inferred' from 'name unknown'. Also, a literal example in a bot's question (e.g. 'reply 3 was bananas') gets copied verbatim by testers, so phrase examples so they can't be mistaken for an answer.
