v1.0.0 now on npm
ML-powered document scanner for the browser.
Detects the four corners of a document. 100% client-side. Tiny.
terminal
$ npm install quadscanscan.ts
import { Quadscan } from 'quadscan';
const r = await Quadscan.scan(file, { mode: 'extract' });
console.log(r);
// { success, corners: { topLeft, topRight, bottomRight, bottomLeft },
// output: HTMLCanvasElement, confidence, timings, ... }ML-powered
DocAligner (LCNet-100) ONNX model. Robust to shadows, low contrast, and beige-on-beige docs that defeat classical CV.
Tiny
~4 KB gzipped of library code. The ~330 KB runtime and the 4.5 MB model are fetched lazily on first scan.
No backend
100% client-side via onnxruntime-web. WebGPU when available, WASM fallback. Nothing leaves the browser.
Why quadscan
Existing browser scanners use classical CV (Canny + contours). That works on clean photos and breaks on shadows, low-contrast paper, beige documents on beige tables. quadscan runs a small ConvNet trained on DocAligner's dataset.
| quadscan | jscanify | OpenCV.js | |
|---|---|---|---|
| Approach | ML (ONNX) | Canny + contours | Canny + contours |
| Library bundle | ~4 KB gz | ~31 MB | ~30 MB |
| Robust to shadows / low contrast | yes | no | partial |
| TypeScript | yes | no | yes |
Ready in 30 seconds.
Drop an image, get back a perspective-corrected scan. No setup, no backend.