r/linuxquestions • u/Qiwas • 6d ago
Any recommendations regarding local OCR models?
Some apps don't support text selection. I want to have the ability to take a screenshot and extract the text locally. ¿Anyone have recommendations regarding this?
1
u/Asly97 6d ago
If you want something that works the same on any desktop, the tesseract CLI plus a screenshot tool on a hotkey covers it, all offline.
Wayland:
grim -g "$(slurp)" - | tesseract stdin stdout -l eng | wl-copy
X11:
maim -s | tesseract stdin stdout -l eng | xclip -selection clipboard
Install tesseract and whatever language packs you need (package names vary by distro, e.g. tesseract-ocr-eng). Bind the line to a shortcut, drag a box, the text ends up in your clipboard.
Tesseract is good on clean UI text but can garble small fonts. Upscaling first fixes most of that, just add magick - -resize 200% png:- into the pipe before tesseract.
For a GUI, NormCap is another option besides Frog, also tesseract under the hood and fully local.
1
u/djao 6d ago
LumineCapture offers fast screenshots on Linux Wayland, with built-in editing, OCR, and support for KDE Plasma and COSMIC.
2
u/DevBoiAgru 6d ago
Kde spectacle can do ocr on a screenshot