A simple and lightweight tool for extracting and translating text from a screenshot/image (on the fly)
Package names may vary by distribution and package manager.
If a package is not found, try searching by its base name (e.g., libglfw3-dev → glfw).
libx11-devgrim(Wayland only)libglfw3-devlibtesseract(including necessary language models, e.gtesseract-ocr-eng)libzar-dev- Python and pip
- Python packages:
pip install --user pillow pystray pyclip pyperclipimg
- From Arch Linux and based:
yay -S python-pillow python-pystray python-pyclip python-pyperclipimg
- Python packages:
-
Install Python from the Microsoft Store or python.org.
Note: Make sure to check the "Add Python to PATH" option during installation. -
Install pip by running the following commands in CMD:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py
-
Install Python packages:
pip install pillow pystray pyclip pyperclipimg
-
Download the required language data for Tesseract from tessdata.
-
Extract the language files to a directory of your choice.
-
Configure the Tesseract and language data paths in the
config.tomlfile (see Windows Configuration section for more details).
$ git clone https://github.com/Toni500github/oshot/
$ cd oshot/
$ make
# You can move it in a custom directory in your $PATH (preferably in the home)
$ ./build/release/oshot$ git clone https://github.com/Toni500github/oshot/
$ cd oshot/
$ mkdir build2 && cd build2
$ cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release
$ ninja
# You can move it in a custom directory in your $PATH (preferably in home)
$ ./oshotAfter installing Tesseract:
- Open the
%APPDATA%directory (press Win+R and type%APPDATA%) - Navigate to the
oshotdirectory - Edit
config.tomland set theocr-pathvariable to your Tesseract data directory- Use double backslashes in the path:
C:\\Users\\Name\\tessdataExample:
- Use double backslashes in the path:
ocr-path = "C:\\Program Files\\Tesseract-OCR\\tessdata"If when starting oshot, it starts to flick the screen black (or it won't launch), try to follow these steps:
- Download MesaForWindows-x64-20.1.8.7z
- Extract the
opengl32.dllfile into the directory whereoshot.exeis located - Try to launch it again
- If when you try to run oshot gives linking library errors, then try to use the AppImage release instead.
- If
oshotdoesn't take the screenshot, then you need to take the screenshot from an external tool and either pipe into stdin or use the-f /path/to/imageflag
If still errors, please open an Issue and take a screenshot/paste the text of the error appearing in the console when executing oshot