A simple Qt application that integrates KDE Spectacle screenshot tool with Tesseract OCR to extract text from screenshots as well QR codes.
- 📷 Capture screenshots using KDE's Spectacle tool
- 🔍 Extract text from screenshots using Tesseract OCR
- 📱 Decode QR codes from screenshots
- 💻 Display extracted text in a user-friendly interface
- 🌍 Support for multiple languages
- ✏️ Edit extracted text before saving
- 📋 Copy text to clipboard
- 💾 Save text to file
- 🖼️ Save the screenshot as .png
- Qt 6.x
- Tesseract OCR
- Leptonica
- KDE Spectacle
- Zxing (for QR code decoding)
Get the binaries from: Releases Page.
Run the application:
./spectacle-ocr-screenshotTip
Create a symlink to the executable in your local PATH for easy access:
sudo ln -s spectacle-ocr-screenshot /usr/local/bin/Then you can run the application from anywhere using or by assigning a keyboard shortcut to spectacle-ocr-screenshot
- Launch Spectacle in region selection mode
- After capturing, click on save, this will save to
/tmp - The extracted text will be displayed in the application window
- You can edit the text, copy it to clipboard or save it to a file
-
--lang <language>: Specify the language(s) for OCR (default: eng)- Use ISO 639-3 language codes
- For multiple languages, join them with '+' (e.g.,
--lang eng+hinfor English and Hindi)
-
--disable-qr: Disable QR code detection
# Use English OCR (default)
./spectacle-ocr-screenshot
# Use German OCR
./spectacle-ocr-screenshot --lang deu
# Use multiple languages (English and Spanish)
./spectacle-ocr-screenshot --lang eng+spaTesseract OCR supports many languages. Some common language codes:
eng- Englishdeu- Germanhin- Hindi
git clone https://github.com/funinkina/spectacle-ocr-screenshot.git
cd spectacle-ocr-screenshotFor Arch Linux:
sudo pacman -S qt6-base tesseract leptonica spectacleFor Ubuntu/Debian:
sudo apt install qt6-base-dev tesseract-ocr libleptonica-dev kde-spectacleFor Fedora:
sudo dnf install qt6-qtbase tesseract leptonica spectacleqmake6 simple.pro
makeMake sure you have cmake installed!
mkdir build && cd build
cmake ..
makeNote
You may need to install language packs for Tesseract OCR separately.
