MENU

AutoOCR

Repository

I built AutoOCR to solve a common friction point in my workflow: extracting text from images or non-selectable UI elements. By combining the Tesseract OCR engine with a low-footprint Rust background service, I created a utility that triggers via a global hotkey, processes clipboard images, and returns the extracted text directly to the user's clipboard in milliseconds.

Multi-threaded Background Service

To ensure the application remains responsive without impacting system performance, I implemented a multi-threaded architecture. A dedicated background thread, powered by the device_query crate, continuously monitors keyboard state for the Shift + Alt + O trigger. By using thread::sleep with a 50ms interval, I kept CPU usage below 0.1% while maintaining snappy hotkey detection.

Tesseract OCR Pipeline

The core OCR logic leverages the leptess crate, a high-level wrapper for the Tesseract engine. The pipeline involves converting raw RGBA data from the clipboard (via arboard) into an RGB format compatible with Leptonica. I optimized this by using Vec::with_capacity to prevent reallocations and multi-language support (eng+deu+hin+pol+rus) to ensure high accuracy across different character sets.

System Tray Integration

Instead of a traditional window, AutoOCR resides in the system tray to stay out of the user's way. I used the tray-icon crate to build a minimalist menu that allows users to quit the application or check the current version. This approach ensures the utility is always available without cluttering the taskbar, adhering to modern Windows utility design patterns.

Technical Impact

By automating the "Screenshot -> Tesseract -> Clipboard" workflow, AutoOCR reduces a 30-second manual process to a 1-second background task. The use of Rust ensures memory safety and high performance, making it a reliable companion for daily productivity. The project also taught me about Windows FFI, clipboard serialization, and the complexities of distributing pre-compiled Tesseract binaries alongside a Rust executable.

Try It Out

Download

If you want to try this app out for yourself, click on the download button and install from GitHub.