arcships/light-ocr

Fast, offline OCR for Node.js & C++. PP-OCRv6 with Core ML / WebGPU hardware acceleration — recognize text in images with confidence scores & coordinates. npm: @arcships/light-ocr

What it solves

light-ocr provides a fast, offline Optical Character Recognition (OCR) solution for Node.js and C++ applications. It eliminates the need for external API calls or complex system-level dependencies, allowing developers to recognize text in images (JPEG, PNG) and PDFs directly on the local machine.

How it works

The project uses the PP-OCRv6 Small model by default and integrates PDFium for document rendering. It is distributed as a single npm package that includes the OCR runtime, models, and necessary fonts, removing the need for post-installation downloads or compilers.

To optimize performance, it automatically detects hardware acceleration: using Core ML on Apple Silicon (macOS 15+), WebGPU (via Vulkan or D3D12) on Linux and Windows, or falling back to the CPU.

Who it’s for

  • Node.js Developers: Those building CLIs, desktop software, or server-side apps that require local text recognition.
  • C++ Developers: Those needing a native static library for OCR integration.
  • AI Agents: The project includes an "Agent Skill" to help AI agents determine when to use deterministic OCR over multimodal models for tasks like receipt extraction or verification.

Highlights

  • Zero-Configuration: One npm install provides everything (model, runtime, PDF renderer, and fonts) with no secondary downloads.
  • Local & Private: All processing happens on-device, ensuring data privacy.
  • Hardware Accelerated: Native support for Core ML and WebGPU for significant speedups over CPU execution.
  • Flexible Inputs: Supports PDF, JPEG, PNG, and raw pixel buffers (GRAY8, RGB8, BGR8, RGBA8).
  • Multi-tier Models: Offers Small (stable), Tiny (ultra-lightweight), and Medium (quality-focused) model options.
  • Tiled Mode: An optional mode to preserve small, dense text in high-resolution images.

Related

  • Project
  • Project
  • Project
  • Project
  • Project