imgrep is a lightweight Qt-based screenshot snipping tool for Linux that lets you select any polygon region of the screen, extract text using OCR, and copy text directly to your clipboard. The meat is in src/overlay/overlay.cpp
- Minimal UI which enables quick snipping
- Polygon or free-form screen snipping that allow precise region selection
- Extract text directly from images using Tesseract OCR
- Auto-copy to clipboard
- Modular design to plug custom text-processors
- C++20
- Qt6 (Widgets + GUI)
- Tesseract OCR
- CMake
- Linux (Ubuntu tested)
- Display Protocols: X11
- OS: Ubuntu
- Text Processor: Copy (copy ocr text to clipboard)
Dependency installation for Ubuntu:
apt install qt6-base-dev tesseract-ocr libleptonica-dev pkg-config
To build imgrep from source follow these steps:
mkdir build
cd build
cmake ..
make -j
./src/imgrep // launch app
Once the tool is launcehed it creates an overlay window above the screen covering full screen length. User can interact with overlay using mouse movements/clicks, shortcut keys and overlay buttons, each interaction performs a specific action within the overlay. Refer the follwoing table for details
| Input | Action | Description |
|---|---|---|
| Left mouse click | Add polygon points/vertex (this automatically creates a line segment between this vertex and the previous vertex) | Place points to outline the region you want to capture |
| Mouse Movement | Preview region | Shows live overlay while selecting area |
| key(U) or Undo button click | Undo Selection | Remove the latest vertex of the polygon, if exists. |
| key(C) or Copy button click | Clipboard copy | Processed OCR text from the image of the selected region is automatically copied |
| key(Esc) or Cancel button Click | Cancel Selection | Abort capture and close the application |
Pro tip: For better usability, try to close/complete the polygon by clicking near the first vertex of the polygon free-form.