Skip to content

feat: Image → Text (OCR) + Receipt Scanner (on-device) - #44

Merged
slaveofcode merged 18 commits into
developfrom
feat/image-ocr
Jul 30, 2026
Merged

feat: Image → Text (OCR) + Receipt Scanner (on-device)#44
slaveofcode merged 18 commits into
developfrom
feat/image-ocr

Conversation

@slaveofcode

Copy link
Copy Markdown
Owner

Adds two on-device tools (nothing leaves the browser except the OCR model, fetched from CDN + cached).

Image → Text (OCR)

PP-OCR (PaddleOCR) via ppu-paddle-ocr on ONNX Runtime Web (WebGPU→WASM). Single image or PDF input, review-&-adjust (rotate / cleanup / threshold), reason-specific errors with retry, editable text + copy + download .txt.

Receipt Scanner + "Parse as receipt"

Heuristic parser over the OCR text + box layout extracts merchant, date, currency, subtotal, tax, total — editable, with JSON/CSV export. Surfaced both as a dedicated Receipt Scanner tool and a Parse as receipt toggle in the OCR tool. Keyword anchors are English but pluggable (ReceiptKeywords) for future languages.

Architecture

Pure, unit-tested libs (ocr.lib, ocr-preprocess.lib, ocr-pdf.lib, receipt.lib, receipt-export.lib); a shared OcrWorkbench component drives both tools; islands stay thin.

Verification

469 tests pass · npm run lint 0 errors · astro build green (both /tools/image-ocr and /tools/image-receipt-scanner build). ORT wasm is runtime-fetched (pruned from the bundle), so no PWA precache bloat.

Specs/plans under docs/superpowers/.

slaveofcode and others added 18 commits July 26, 2026 23:04
fix(updater): generate latest.json/.sig + remove internal dev docs
fix(theme) + docs: dark-mode persistence, merged DEPLOYMENT, GA env clarity
feat(shell): Settings nav link desktop-only
chore: trigger production rebuild (SITE_GA_ID)
feat: hide desktop-only tools (Hotkey Test) from web
chore(release): desktop v1.0.0-beta.2
docs(release): fix macOS Gatekeeper guidance
Promote to production: FFmpeg bundling + lint cleanup
PP-OCR pipeline on ONNX Runtime Web (WebGPU/WASM), single image + PDF input,
review-&-adjust preprocessing, reason-specific errors. Structured receipt
parsing, multi-language, and batch deferred to later phases.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rors

ppu-paddle-ocr@6.2.0 (PP-OCRv5 on ONNX Runtime Web, WebGPU/WASM). SDK boundary
isolated to ocr.engine.ts; ocr.lib holds tested logic (caching, row-grouped text
assembly, OcrError reasons).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Single image + PDF input, review-&-adjust (rotate/cleanup/threshold), on-device
inference, reason-specific errors with retry. Crop UI + box overlay deferred.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Heuristic parser over OCR text+box layout; pluggable ReceiptKeywords (English
now, language-extensible); 'Parse as receipt' toggle + dedicated Receipt Scanner
tool; editable fields, JSON/CSV export.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
parseReceipt over OCR text+box layout (merchant/date/currency/subtotal/tax/total);
pluggable ReceiptKeywords (English now, language-extensible); receiptToJson/Csv.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extract shared OcrWorkbench from ImageOcr (behavior-preserving); editable
ReceiptFields with JSON/CSV/copy export; new image-receipt-scanner tool.
Parsed data memoized per OCR result so edits survive re-renders.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
goodwebtools 3f206d2 Jul 30 2026, 04:52 PM

@slaveofcode
slaveofcode merged commit 50fc2c0 into develop Jul 30, 2026
2 checks passed
@slaveofcode
slaveofcode deleted the feat/image-ocr branch July 30, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant