Skip to content

Linux Screenshot and OCR

Copying text into the clipboard where for one reason or another it’s otherwise not possible. Text is on screen and processed into OCR to the clipboard.

Terminal window
flameshot gui --raw \
| tesseract stdin stdout -l eng \
| xclip -in -selection clipboard
# flameshot :: Powerful yet simple to use screenshot software
# tesseract :: Tesseract Open Source OCR Engine
# xclip :: Command line interface to the X11 clipboard
# If you're using Wayland, substitute xclip for wl-copy:
flameshot gui --raw \
| tesseract stdin stdout -l eng \
| wl-copy

Some Reddit users suggested these alternatives to flameshot

Terminal window
# maim :: (make image) takes screenshots of your desktop.
# grim :: Grab images from a Wayland compositor
grim -g "$(slurp)" - \ ...
maim -s \ ...