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-devlibxcb-devlibpng-devlibglfw3-devlibtesseract(including necessary language models, e.gtesseract-ocr-eng)libzbar-devlibappindicator3-devgrim(Wayland only)wl-clipboard(Wayland only)
- 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 a screen black (or it won't launch), try the following steps:
- Download MesaForWindows-x64-20.1.8.7z
- Extract the
opengl32.dllfile into the directory whereoshot.exeis located - Try to launch it again
- If oshot gives linking library errors, when trying to run it, 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