Skip to content

OCR Tesseract integration #4228

Open
rokokol wants to merge 1 commit intoflameshot-org:masterfrom
rokokol:Tesseract-integration
Open

OCR Tesseract integration #4228
rokokol wants to merge 1 commit intoflameshot-org:masterfrom
rokokol:Tesseract-integration

Conversation

@rokokol
Copy link
Copy Markdown

@rokokol rokokol commented Sep 7, 2025

Title: Add Tesseract OCR integration

Description:
This PR introduces integration with Tesseract OCR. Users can now copy text from a selected area to the clipboard using SelectionTextTool. The tool automatically detects and uses all available language packs. Just use the button with tesseract icon

Changes include:

  • Implementation of OCR logic in selectiontexttool.cpp.
  • Automatic tessdata path detection across Windows, macOS, and Linux.
  • Automatic gathering of all installed languages.
  • Clipboard support for both standard and selection buffers, including Wayland compatibility.

This feature enables seamless text recognition from screenshots or selected regions.

Deployment
I use Linux Mint Cinnamon 22.2. You should to install the tesseract and, for example, the English package:

sudo apt install tesseract-ocr tesseract-ocr-eng

@rokokol rokokol changed the title Tesseract integration added OCR Tesseract integration f Sep 7, 2025
@rokokol rokokol changed the title OCR Tesseract integration f OCR Tesseract integration Sep 7, 2025
@borgmanJeremy
Copy link
Copy Markdown
Collaborator

Thank! I will review more closely at my PC. But at a high level I think we should make this an optional integration so tesseract is not a hard dependency. @mmahmoudian what are your thoughts?

@mmahmoudian
Copy link
Copy Markdown
Member

mmahmoudian commented Sep 8, 2025

@borgmanJeremy I remember this being discussed before. OCR is out of the scope of a screenshot tool and therefore it is better if we have this as a plugin. I think it worth the effort to push the plugin system forward.

Update: I collected these:
The #702 is the feature request.
This is already implemented 3 times before this PR:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants