Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A simple utility to automatically extract text from spectacle on plasma desktops

License

NotificationsYou must be signed in to change notification settings

funinkina/spectacle-ocr-screenshot

Repository files navigation

A simple Qt application that integrates KDE Spectacle screenshot tool with Tesseract OCR to extract text from screenshots as well QR codes.

Screenshot

Features

  • 📷 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

Requirements

  • Qt 6.x
  • Tesseract OCR
  • Leptonica
  • KDE Spectacle
  • Zxing (for QR code decoding)

Installation

Get the binaries from:Releases Page.

Usage

Run the application:

./spectacle-ocr-screenshot

Tip

Recommended Usage

Create a symlink to the executable in your localPATH 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 tospectacle-ocr-screenshot

The application will:

  1. Launch Spectacle in region selection mode
  2. After capturing, click on save, this will save to/tmp
  3. The extracted text will be displayed in the application window
  4. You can edit the text, copy it to clipboard or save it to a file

Command Line Options

  • --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+hin for English and Hindi)
  • --disable-qr: Disable QR code detection

Examples:

# 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+spa

Available Languages

Tesseract OCR supports many languages. Some common language codes:

  • eng - English
  • deu - German
  • hin - Hindi

Manual Installation

Building from Source

1. Clone the repository:

git clone https://github.com/yourusername/spectacle-ocr-screenshot.gitcd spectacle-ocr-screenshot

2. Install build dependencies:

For Arch Linux:

sudo pacman -S qt6-base tesseract leptonica spectacle

For Ubuntu/Debian:

sudo apt install qt6-base-dev tesseract-ocr libleptonica-dev kde-spectacle

For Fedora:

sudo dnf install qt6-qtbase tesseract leptonica spectacle

3. Build the project:

git clone https://github.com/funinkina/spectacle-ocr-screenshotqmake6 simple.promake

You can also build usingcmake:

Make sure you have cmake installed!

mkdir build&&cd buildcmake ..make

Note

You may need to install language packs for Tesseract OCR separately.

License

MIT

Star History

Star History Chart

About

A simple utility to automatically extract text from spectacle on plasma desktops

Topics

Resources

License

Stars

Watchers

Forks

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp