Skip to content

Repository files navigation

Screen OCR Translator

CI status Latest release MPL-2.0 license

Browser extension that uses local OCR to extract text from images, comics, scans, or any selected area of a web page, then displays the translation in an overlay or in a panel. It uses Google Translate by default, or you can connect it to your own LLM endpoint.

Get the Firefox add-on Get from Chrome Web Store

Features

  • Select any area of a web page and translate it in place.
  • Translate images directly from the context menu.
  • Run OCR locally in your browser using bundled PaddleOCR models.
  • Recognize multilingual text with automatic script detection. See supported languages.
  • Group text lines using speech-bubble and free-text regions detected by a local layout model.
  • Translate recognized text with Google Translate (no API key required) or an OpenAI-compatible LLM endpoint (local or remote).
  • Copy or listen to the original and translated text, or view them side by side.

Usage

Activate the extension from the browser toolbar or context menu, or press Ctrl+Shift+F. Select an area of the page and click "Recognize text".

To translate an image directly, right-click it and select "Translate this image".

By default, translations appear over the original text. You can switch to showing a panel from the toolbar's context menu.

The default shortcut is Ctrl+Shift+F. To change it in Firefox, open about:addons, click the gear button, and select Manage Extension Shortcuts. In Chrome, open chrome://extensions/shortcuts.

Note

To use the extension on local image files, you need to grant access to local files.

  • Firefox: open the add-on's Permissions and data settings and enable Access local files on your computer.
  • Chrome: open the extension details and enable Allow access to file URLs.

After granting the permission, reload the image and try again.

Supported languages

Text recognition

The extension bundles several recognizer models. The general recognizer is PP-OCRv6. It's a multilingual model that supports 50 languages and provides the best accuracy. Other scripts use separate PP-OCRv5 recognizers.

Model Recognized languages
PP-OCRv6 (multilingual) Afrikaans, Albanian, Azerbaijani, Basque, Bosnian, Catalan, Chinese (Simplified & Traditional), Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Hungarian, Icelandic, Indonesian, Irish, Italian, Japanese, Latvian, Lithuanian, Malay, Norwegian, Polish, Portuguese, Romanian, Serbian (Latin), Slovak, Slovenian, Spanish, Swahili, Swedish, Tagalog, Turkish, Uzbek, Vietnamese, Welsh
Cyrillic-PP-OCRv5 Belarusian, Bulgarian, Kazakh, Macedonian, Mongolian, Russian, Serbian (Cyrillic), Ukrainian
Korean-PP-OCRv5 Korean
Arabic-PP-OCRv5 Arabic, Pashto, Persian, Urdu
Devanagari-PP-OCRv5 Hindi, Marathi, Nepali

When the source language is set to Auto, a local classifier detects the script and selects the matching recognizer.

Translation

Recognized text can be translated into any language supported by Google Translate, or any language supported by your configured LLM endpoint.

If Ollama returns HTTP 403, enable Remove Origin header in the LLM endpoint settings.

Limitations

Recognized text lines are grouped into regions using a bundled RT-DETR model. It may still miss or incorrectly group very small text, tables, or dense multi-column layouts. Selecting a smaller area can improve results.

WebGPU setup

Warning

GPU acceleration is experimental. Depending on your browser, OS and hardware, it may make text recognition faster or slower. You can enable it in settings.

On Linux, WebGPU is generally disabled by default. Follow the steps below to enable it.

Firefox

  1. Open about:config.
  2. Set dom.webgpu.enabled to true.
  3. Restart the browser.

See the Firefox guide on enableGPU.com for a walkthrough.

Chromium

  1. Open chrome://flags.
  2. Enable both of these flags:
    • Unsafe WebGPU Support (chrome://flags/#enable-unsafe-webgpu)
    • Vulkan (chrome://flags/#enable-vulkan)
  3. Restart the browser.

Privacy

  • Captured images are processed locally.
  • Recognized text is sent to the selected translation provider for translation.
  • Settings and API keys are stored locally. An API key is sent only to the endpoint configured by the user.

See the Privacy Policy for details.

Development

Built with WXT and TypeScript.

npm ci
npm run dev         # Firefox
npm run dev:chrome  # Chrome

Dev mode launches the browser with the extension installed and reloads it on changes.

To test a production build, run:

npm run build         # Firefox
npm run build:chrome  # Chrome

The builds generate unpacked extensions in .output/firefox-mv3 and .output/chrome-mv3.

  • Firefox: load the directory as a temporary add-on. See Temporary installation in Firefox.
  • Chrome: load the directory via Load unpacked on chrome://extensions with Developer mode on.

Run the test suite and type checks with:

npm test
npm run typecheck

License

Screen OCR Translator is licensed under the Mozilla Public License 2.0. Bundled libraries, runtime files, and OCR models retain their original licenses. See THIRD_PARTY_NOTICES.md.

About

Extract and translate text from images or any selected area of a web page using local OCR

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages