A lightweight, open-source OCR tool for the Linux desktop. Open an image or capture a screenshot, and RustyLens extracts the text using Tesseract — with bounding-box overlays and drag-to-select word copying.
Built with Rust, GTK4, and libadwaita.
If the video does not play in your browser, download it here.
- OCR text extraction — supports 100+ languages; auto-detects all installed Tesseract language packs
- Drag-to-select — click or drag across highlighted words to select them, then Ctrl+C to copy
- Bounding-box overlay — recognised words are highlighted on the image preview
- Screenshot mode —
rustylens --capturegrabs a screenshot via the XDG portal and runs OCR immediately - Language selector — dropdown showing human-readable names ("English", "Japanese", "Chinese (Simplified)"); "Auto (all)" uses every installed pack
- Copy all text — one-click button to copy the full extracted text
- Flatpak-ready — fully sandboxed with portal-based screenshot integration
Clone the repository and run the installer. It auto-detects your distro and downloads the correct native binary and English language pack:
git clone https://github.com/Pranavk-official/rustylens.git
cd rustylens
./install.sh --minimalThen launch:
rustylensFor other install formats (AppImage, Flatpak, manual), see Installation.
install.sh auto-detects your distro (Arch, Ubuntu/Debian, Fedora/RHEL), downloads the matching native binary from GitHub Releases, and sets up Tesseract language packs. On unknown distros (Alpine, Void, openSUSE), it falls back to the AppImage automatically.
Choose your language packs:
./install.sh --minimal # English only (default)
./install.sh --european # Western + Eastern European
./install.sh --asian # East Asian (CJK, Korean, Vietnamese)
./install.sh --full # All language groups
./install.sh --langs "eng fra jpn" # Custom selection
./install.sh --no-langs # Skip language packs entirelyChoose your install format:
./install.sh --minimal # Auto-detect distro; download native binary
./install.sh -A --minimal # Force AppImage (bundled libs, any distro)
./install.sh -F # Flatpak (fully sandboxed, 128 language packs)
./install.sh --local ./RustyLens-x86_64.AppImage # Install from a local fileInstalls to ~/.local/bin/rustylens by default. Override with --prefix /usr/local.
Update and uninstall:
./install.sh --update # Re-download latest release in the same format
./install.sh --uninstall # Remove binary, desktop entry, and iconNon-interactive / CI:
NONINTERACTIVE=1 ./install.sh --minimalDownload from GitHub Releases:
| File | Description |
|---|---|
rustylens-linux-x86_64-arch.tar.gz |
Native binary for Arch / Garuda / Manjaro (leptonica 1.84+) |
rustylens-linux-x86_64-ubuntu.tar.gz |
Native binary for Debian / Ubuntu / Mint / Pop |
rustylens-linux-x86_64-fedora.tar.gz |
Native binary for Fedora / RHEL / Rocky / Alma / Nobara |
rustylens-linux-x86_64.tar.gz |
Generic binary (same as ubuntu build, backward compat) |
rustylens.flatpak |
Self-contained Flatpak bundle — all 128 language packs included |
RustyLens-x86_64.AppImage |
Portable AppImage — GTK4 and all libraries bundled |
RustyLens-*-apple-darwin.dmg |
macOS DMG with bundled dylibs (requires Tesseract tessdata) |
rustylens-windows-x86_64.zip |
Windows zip with bundled DLLs and English tessdata |
Choosing a Linux binary: native tarballs link against your distro's leptonica version, avoiding ABI mismatches (e.g.
liblept.soversion conflicts). The AppImage and Flatpak bundle all libraries, so no system OCR libraries are needed.
Install the runtime libraries for your distro, then extract the binary:
Arch Linux:
sudo pacman -S leptonica tesseract
sudo pacman -S tesseract-data-eng # English (or other language packs)
tar xzf rustylens-linux-x86_64-arch.tar.gz
install -Dm755 rustylens ~/.local/bin/rustylensDebian / Ubuntu:
sudo apt install libleptonica-dev libtesseract-dev tesseract-ocr-eng
tar xzf rustylens-linux-x86_64-ubuntu.tar.gz
install -Dm755 rustylens ~/.local/bin/rustylensFedora:
sudo dnf install leptonica tesseract tesseract-langpack-eng
tar xzf rustylens-linux-x86_64-fedora.tar.gz
install -Dm755 rustylens ~/.local/bin/rustylensTo register the app in your desktop launcher, also install the .desktop entry and icon from the cloned repo:
install -Dm644 data/io.github.pranavk_official.RustyLens.desktop \
~/.local/share/applications/io.github.pranavk_official.RustyLens.desktop
install -Dm644 data/icons/hicolor/scalable/apps/io.github.pranavk_official.RustyLens.svg \
~/.local/share/icons/hicolor/scalable/apps/io.github.pranavk_official.RustyLens.svgflatpak install --user rustylens.flatpakchmod +x RustyLens-x86_64.AppImage
./RustyLens-x86_64.AppImageOr copy it to your PATH for system-wide access:
install -Dm755 RustyLens-x86_64.AppImage ~/.local/bin/rustylensFor developers and contributors. End users should use
install.shor a pre-built release.
System dependencies:
| Distro | Command |
|---|---|
| Arch | sudo pacman -S clang gtk4 libadwaita leptonica tesseract |
| Debian/Ubuntu | sudo apt install clang libgtk-4-dev libadwaita-1-dev libleptonica-dev libtesseract-dev |
| Fedora | sudo dnf install clang gtk4-devel libadwaita-devel leptonica-devel tesseract-devel |
| macOS | brew install gtk4 libadwaita leptonica tesseract |
| Windows | Install MSYS2/MINGW64; pacman -S mingw-w64-x86_64-{gtk4,libadwaita,leptonica,tesseract} |
Also install Rust 1.85+ (required for the 2024 edition).
git clone https://github.com/Pranavk-official/rustylens.git
cd rustylens
cargo build --releaseThe binary is at target/release/rustylens (~2 MB).
cargo install --path .
# Register the desktop entry and icon:
install -Dm644 data/io.github.pranavk_official.RustyLens.desktop \
~/.local/share/applications/io.github.pranavk_official.RustyLens.desktop
install -Dm644 data/icons/hicolor/scalable/apps/io.github.pranavk_official.RustyLens.svg \
~/.local/share/icons/hicolor/scalable/apps/io.github.pranavk_official.RustyLens.svgProduces a portable RustyLens-x86_64.AppImage (~50 MB) without needing Flatpak.
Additional dependency: squashfs-tools (and pkg-config on some distros). linuxdeploy is downloaded automatically if not present.
./build-appimage.sh # Full build (cargo + AppImage)
./build-appimage.sh --skip-build # Reuse existing binary
./build-appimage.sh --install # Build and install to ~/.local/bin/rustylens
./build-appimage.sh --clean # Clean build artefacts firstOr with Make:
make appimage # Build AppImage
make appimage-install # Build + install to ~/.local/bin# One-time SDK setup:
flatpak install flathub org.gnome.Platform//49 org.gnome.Sdk//49
flatpak install flathub org.freedesktop.Sdk.Extension.rust-stable//25.08
# Build and install:
flatpak-builder --user --install --force-clean build-dir io.github.pranavk_official.RustyLens.jsonmake build # cargo build --release
make run # Build + run GUI
make appimage # Build AppImage
make install # Install AppImage + desktop entry to ~/.local
make install-langs # Install English Tesseract pack (edit LANGS= to change)
make test-docker # Run full Docker test suite (install.sh + build-appimage.sh)
make clean # cargo clean + remove AppDir / AppImage artefacts
make release # Build + tag a new release commit# Via install.sh (recommended):
./install.sh --uninstall
# Standalone binary (installed manually):
rm ~/.local/bin/rustylens
rm ~/.local/share/applications/io.github.pranavk_official.RustyLens.desktop
rm ~/.local/share/icons/hicolor/scalable/apps/io.github.pranavk_official.RustyLens.svg
# cargo install:
cargo uninstall rustylens
# Flatpak:
flatpak uninstall --user io.github.pranavk_official.RustyLens
# AppImage:
rm ~/.local/bin/rustylensrustylens- Click Open Image to pick an image through your desktop's file chooser.
- OCR runs automatically — extracted text appears in the panel below the image.
- Select text: click on any highlighted word to select it, or click and drag across multiple words to select a range. Press Ctrl+C to copy selected words to the clipboard.
- Use Copy All Text to copy everything at once.
- Change the OCR language from the dropdown in the header bar. "Auto (all)" uses every installed language pack.
rustylens --captureOpens an interactive screenshot selection (via the XDG Desktop Portal), then loads the captured image for OCR.
RustyLens automatically detects all Tesseract language packs installed on your system by scanning the tessdata directory (typically /usr/share/tessdata/). To add a new language:
- Install the language pack for your distro (e.g.,
sudo pacman -S tesseract-data-frafor French). - Restart RustyLens — the new language appears in the dropdown with its full name (e.g. "French" rather than
fra).
The "Auto (all)" option uses all installed languages simultaneously. For best accuracy and speed, select the specific language you need.
Some common language codes for install.sh --langs and --capture mode:
| Code | Language |
|---|---|
eng |
English |
jpn |
Japanese |
chi_sim |
Chinese (Simplified) |
chi_tra |
Chinese (Traditional) |
kor |
Korean |
deu |
German |
fra |
French |
spa |
Spanish |
ara |
Arabic |
hin |
Hindi |
For the full list of codes, see the Tesseract data files documentation.
- Image loading —
gtk::FileDialogopens the native file chooser (GTK4 transparently uses the XDG portal when running inside a Flatpak). The selectedGFilepath is passed directly to Tesseract. - OCR — runs on a background thread to avoid blocking the UI. Tesseract processes the image and returns both the full text and per-word bounding boxes (via TSV output).
- Bounding boxes — a transparent
gtk::DrawingAreaoverlay renders word rectangles using Cairo, scaled to match the image's "Contain" fit. - Word selection — a
GestureDraghandler lets you click or drag across highlighted words to select a range. Ctrl+C copies selected words in reading order. - Portal integration — the XDG Screenshot Portal (via ashpd/zbus) handles the
--capturescreenshot mode, running on a shared persistent Tokio runtime for reliable D-Bus communication.
.
├── src/
│ ├── main.rs Entry point, CLI flag, application setup
│ ├── ui.rs Window construction, word selection, drawing callbacks
│ ├── portal.rs XDG Screenshot Portal wrapper, shared Tokio runtime, background tasks
│ └── ocr.rs Tesseract OCR via leptess, language detection, TSV bbox parsing
├── data/
│ ├── icons/hicolor/scalable/apps/
│ │ └── *.svg App icon
│ ├── *.desktop Desktop entry
│ └── *.metainfo.xml AppStream metadata
├── build-appimage.sh Local AppImage builder (two-pass linuxdeploy + mksquashfs)
├── install.sh Cross-distro installer: native binary, AppImage, Flatpak, and tessdata
├── local-scripts/ Local-only scripts (not committed)
│ ├── test-install.sh Docker test harness for install.sh
│ ├── test-build-appimage.sh Docker test harness for build-appimage.sh
│ └── test-makefile.sh Docker test harness for Makefile targets
├── Makefile Developer task shortcuts
├── Cargo.toml
├── CHANGELOG.md
└── io.github.pranavk_official.RustyLens.json Flatpak manifest
Contributions are welcome! Please open an issue or pull request. For full documentation see the docs site.
When building for development, use the debug build for faster compile times:
cargo build
./target/debug/rustylensThere is no test suite yet. When adding tests, prefer integration tests in tests/ for portal/UI logic and unit tests for pure functions (e.g., parse_tsv_words).
This project is licensed under the GNU General Public License v3.0 or later.

