Files
scan-tools/public/README.md
T
zemion 8f34d05b75
Verify / verify (push) Canceled after 0s
Release Scan Tools 0.2.0
2026-09-02 10:57:17 +02:00

3.2 KiB
Raw Blame History

Scan Tools

Correct photographed document pages, assemble them, optionally recognize English text, and export images or PDFs without sending content away. Scan Tools is a local-first module in the add·ideas Toolbox.

v0.2.0 capabilities

  • Add up to 24 browser-decodable PNG, JPEG or WebP images through a file or camera-enabled picker
  • Drag four document corners to apply an actual projective correction; handles support keyboard movement and precise percentage-coordinate entry
  • Rotate in quarter turns, adjust deskew manually, or estimate a text-line correction within ±5 degrees
  • Tune brightness and contrast, retain colour, convert to grayscale, or create black-and-white pages using Otsu or a manual threshold
  • Preserve the previous preview until its debounced replacement is ready
  • Run perspective correction, pixel adjustment, rotation and deskew analysis in cancellable OffscreenCanvas workers with progress; fall back to bounded main- thread canvases only where those browser APIs are unavailable
  • Reorder pages with drag and drop, remove them without touching source files, and export the selected page as PNG or JPEG
  • Assemble every corrected page into A4, US Letter, or source-sized image-only PDFs with a configurable margin
  • Run optional English OCR using a bundled integer model and same-origin Tesseract.js WebAssembly runtime; inspect word geometry and export editable text, hOCR, TSV, or combined multipage text
  • Work at nested paths, install as an offline PWA, use the shared system/light/ dark themes, and perform no remote content request

Honest scope and limits

This first release does not automatically detect page corners, remove fingers or shadows, process input PDFs, recognize handwriting reliably, or create a searchable invisible PDF text layer. Geometry is exported separately so an unverified alignment is never embedded into the PDF. OCR confidence is engine evidence, not an accuracy guarantee. Perspective correction is high-quality bilinear resampling; each new render is lossy unless exported as PNG.

There are explicit limits of 24 pages, 32 MiB and 80 decoded megapixels per source image, 24 megapixels for a working source raster, 1.2 megapixels for an interactive preview, 10 megapixels per exported page, and 4 megapixels for OCR. Optional OCR loads only after confirmation and may use roughly 100300 MiB of transient memory. The bundled model is English only.

Files, decoded pixels, correction settings and OCR text live in memory. The same-origin OCR files are included in the release rather than downloaded from a CDN. Nothing is uploaded, but an exported image or PDF naturally contains the visible page and an exported text file contains the recognized text.

Development

npm ci
npm run check
npm run test:browser

npm run release:artifact produces a deterministic ZIP and SHA-256 sidecar. The build copies pinned OCR assets from installed npm packages into the static release; generated public/ocr/ content is not source-controlled.

License

GPL-3.0-or-later. See LICENSE. Tesseract.js is Apache-2.0, the English trained data package is MIT, and jsPDF is MIT; release artifacts include the complete generated runtime licence inventory.