AutoOCR
AutoOCR solves a concrete workflow problem: extracting text from screenshots, error dialogs, or any non-selectable UI element. A Rust background service listens for a global hotkey, pulls an image from the clipboard, runs it through the Tesseract OCR engine, and writes the result back to the clipboard in under a second.
Multi-threaded Background Service
A dedicated background thread, powered by the device_query crate, continuously polls keyboard state for the Shift + Alt + O combination. The polling interval is set to 50ms via thread::sleep, which keeps CPU usage below 0.1% while still providing responsive hotkey detection. A 1000ms cooldown after each trigger prevents repeated firings from a held key.
Tesseract OCR Pipeline
The OCR pipeline uses the leptess crate, a wrapper around the Tesseract engine. Clipboard image data arrives as raw RGBA bytes via arboard and must be converted to RGB before Leptonica can process it. Vec::with_capacity pre-allocates the output buffer to avoid per-chunk reallocations. The engine is initialized with five language packs (eng+deu+hin+pol+rus) to handle varied character sets without additional configuration.
System Tray Integration
AutoOCR runs without a main window. The tray-icon crate provides a system tray icon with a minimal menu containing a quit action and version info. This keeps the process available at all times without occupying taskbar space.
Technical Impact
The full Screenshot-to-Clipboard pipeline completes in roughly 1 second, replacing a 30-second manual workflow of opening an OCR tool, loading an image, copying output, and closing it. Building this project required working with Windows FFI for clipboard access, understanding clipboard image serialization, and solving distribution challenges around bundling pre-compiled Tesseract binaries with the Rust executable.
Try It Out
DownloadIf you want to try this app out for yourself, click on the download button and install from GitHub.