Skip to content
WizerdBaChePublic

About

極輕量、開箱即用螢幕智慧取字工具。Win+Shift+C 瞬間定格擷取,內建 Windows 離線 OCR 並整合 CJK 斷字清理與程式碼縮排還原;放開滑鼠時按住 Shift 鍵,即可選配本地 Ollama 離線視覺模型或雲端大模型進行 AI 增強,根治低對比與複雜字幕。

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

FlashGrab ⚡

🇹🇼 繁體中文 | English

Lightning-fast screen text extraction for Windows.

Freeze. Grab. OCR. Copy.

Win + Shift + C → Freeze Frame → Offline OCR → Smart Cleanup → Clipboard


FlashGrab is an ultra-lightweight Windows screen text extraction tool inspired by the simplicity of G-Helper.

Unlike traditional OCR utilities, FlashGrab freezes the screen the moment you press the shortcut, allowing you to capture subtitles, videos, terminals, and other dynamic content without racing against the screen.

By default, everything runs 100% offline using Windows' built-in OCR engine. For difficult scenes, simply hold Shift when releasing the mouse to enable optional AI Vision enhancement.


✨ Features

  • ⚡ Instant Freeze Frame capture
  • 📴 100% Offline Windows OCR
  • 🇹🇼 Smart CJK spacing restoration
  • 💻 Automatic code indentation recovery
  • 🧠 Optional AI Vision enhancement (Ollama / Gemini / NIM)
  • 📋 Automatic clipboard copy
  • 🔒 Privacy-first design (no background network activity)

🚀 Why FlashGrab?

Traditional OCR tools usually capture the screen after you finish selecting, which causes issues with moving text.

FlashGrab captures the screen immediately when the shortcut is pressed, so dynamic content stays exactly as you saw it.

Perfect for:

  • Video subtitles & Live streams
  • Terminal output & Notifications
  • Presentations & PDF viewers
  • Documentation & Source code

⚙️ How It Works

Win + Shift + C
       │
       ▼
 Freeze Frame
       │
       ▼
  Offline OCR
       │
       ▼
 Smart Cleanup
       │
       ▼
   Clipboard

Hold Shift while releasing the mouse to replace the Offline OCR stage with AI Vision.


🧠 Recognition Pipeline

Offline Mode (Default)

FlashGrab uses Windows' native Windows.Media.Ocr engine together with several post-processing stages designed specifically for developers and CJK languages.

1. Smart CJK Cleanup

Windows OCR often inserts spaces between every Chinese character. FlashGrab intelligently restores:

這 是 一 段 文 字

↓

這是一段文字

while preserving proper spacing between Chinese and English words.

2. Code Indentation Recovery

FlashGrab estimates character width and reconstructs indentation levels automatically. Highly useful for structured or monospace source code like C#, C++, Python, JavaScript, JSON, and YAML.

3. Safe Token Guard

Safely normalizes common OCR character mistakes under strict verification:

  • OpenAI → OpenAI
  • 2O25 → 2025

🤖 AI Vision (Optional)

Need even better recognition for low-contrast text or complex watermarks? Simply hold Shift while releasing the mouse. FlashGrab will use an OpenAI-compatible Vision model instead of the offline OCR engine.

  • Recommended Local Setup: Ollama (e.g., maternion/LightOnOCR-2), LM Studio.
  • Supported Cloud Providers: Google Gemini, NVIDIA NIM, or any OpenAI-compatible Vision endpoint.

AI mode is completely optional. If no AI backend is configured, FlashGrab remains 100% offline.


⌨️ Keyboard Shortcuts

Action Result
Win + Shift + C Freeze screen and start selection (default; changeable, see below)
Left Mouse Drag Select OCR region
Hold Shift while releasing Trigger Tier 2 AI Vision
Esc or Right Click Cancel selection and exit

If the shortcut does nothing

Another running program may already own Win + Shift + C (Windows lets only one program hold a global shortcut, and gives no way to see who). FlashGrab never fails silently about it:

  • At startup it falls back automatically to Win + Shift + X, then Ctrl + Alt + C, then Ctrl + Alt + Shift + C (for this run only; nothing is written to settings), and shows a topmost dialog saying which key is now in effect. It does not rely on toast notifications, which Do Not Disturb swallows.
  • If every combination is taken, the dialog says so, the tray tooltip reads "shortcut not active", and the tray menu gets a red ⚠ entry at the top.
  • To pick your own: tray icon → Settings → Capture shortcut (modifier checkboxes + one key: A–Z, 0–9, F1–F12; at least one modifier is required). On Save, FlashGrab registers the new combination for real and refuses to save if it is taken. The choice is stored as "Hotkey": "Ctrl+Alt+C" in settings.json; absent means the default.

📦 Releases

One download, deliberately — there is no second, smaller build to pick by mistake.

FlashGrab-Portable.exe

  • ~75 MB
  • Self-contained — no .NET runtime, no prerequisites
  • Portable and USB-friendly

Verifying your download

The release ships a SHA256SUMS.txt alongside the .exe. The executable is not Authenticode-signed, so the hash is what tells you the file is the one that was built:

Get-FileHash .\FlashGrab-Portable.exe -Algorithm SHA256

Compare the result with the line in SHA256SUMS.txt (that file records the hash in lower case; Get-FileHash prints upper case — the comparison is case-insensitive).

Building from source? .\publish.ps1 -FrameworkDependent additionally produces the ~25 MB framework-dependent FlashGrab.exe in publish\_fd\. It is for local testing only: it requires the .NET 8 Desktop Runtime and is deliberately kept out of publish\dist\ and out of SHA256SUMS.txt, so it can never be handed to someone by accident.

No installer needed — just double-click the .exe. FlashGrab starts directly in the background (system tray, bottom-right). A toast confirms "Running in the background — press Win + Shift + C", and a one-time welcome window appears on first launch. There is no main window; right-click the tray icon for settings. Running it again while it's already open just shows a reminder instead of opening a second copy.


⚙️ Configuration

Configuration file is automatically created at:

%AppData%\FlashGrab\settings.json

API key storage

If you configure a cloud AI provider, its API key is encrypted with Windows DPAPI (CurrentUser scope) before it is written to disk. settings.json contains only the ciphertext, in the Tier2ApiKeyProtected field.

Be clear about what that does and does not buy you:

  • ✅ Copying settings.json to another machine, another Windows account, a backup, or a cloud-sync folder yields an unusable blob — decryption fails and FlashGrab treats the key as unset.
  • ✅ Another local account on this PC cannot read the key out of the file.
  • ❌ It does not protect against code running as your own Windows user. Anything running under your account can call the same decryption API you can. DPAPI is at-rest protection for the file, not a defence against local malware.

Settings files written by v0.4.1 and earlier stored the key in clear text. They are migrated automatically on first launch — the key is re-encrypted in place and the plaintext field is removed, so you do not need to re-enter it. Because the key did sit on disk in clear text, the migration is recorded in %AppData%\FlashGrab\security.log and rotating that key at your provider is recommended.

For local Ollama setup, ensure your model is running before executing the AI grab:

ollama run maternion/LightOnOCR-2

🔒 Privacy

Privacy is a core design principle. By default, FlashGrab never uploads screenshots, never sends OCR data anywhere, and never requires internet access. Network requests only occur if you explicitly configure and opt-in to a cloud AI provider.


📊 Comparison

Feature FlashGrab PowerToys Text Extractor
Freeze Frame Capture ✅ ❌
Offline OCR ✅ ✅
Smart CJK Cleanup ✅ ❌
Code Indentation Recovery ✅ ❌
Optional AI Vision ✅ ❌
Portable Version ✅ ❌

🛠 Roadmap

  • ✅ Freeze Frame capture
  • ✅ Offline OCR
  • ✅ Smart CJK cleanup
  • ✅ Code indentation recovery
  • ✅ AI Vision enhancement
  • ⬜ Translation
  • ⬜ Table recognition
  • ⬜ Batch OCR

📄 License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.

About

極輕量、開箱即用螢幕智慧取字工具。Win+Shift+C 瞬間定格擷取,內建 Windows 離線 OCR 並整合 CJK 斷字清理與程式碼縮排還原;放開滑鼠時按住 Shift 鍵,即可選配本地 Ollama 離線視覺模型或雲端大模型進行 AI 增強,根治低對比與複雜字幕。

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages