Skip to content

ScanicDocument scanning for the modern Web

Professional-grade edge detection and perspective correction in the browser and Node.js, powered by Rust/WebAssembly. Under 100KB, ~10ms transforms.

Scanic

Quick start

sh
npm install scanic
sh
pnpm add scanic
sh
yarn add scanic
sh
bun add scanic
js
import { scanDocument } from 'scanic'

// Detect the document and get a perspective-corrected crop
const result = await scanDocument(imageElement, { mode: 'extract' })

if (result.success) {
  document.body.appendChild(result.output) // a <canvas> with the flattened page
}

Read the Getting Started guide →

Released under the MIT License.