Capture2Text Command Line Options: Complete CLI Manual

Two Executables: GUI and CLI

The Capture2Text folder contains two programs. Capture2Text.exe is the familiar GUI app with hotkeys and the tray icon. Capture2Text_CLI.exe is its command-line sibling: it OCRs image files or a rectangle of your screen and writes the text to stdout or a file — no windows, no hotkeys. The CLI is ideal for batch jobs, scheduled tasks, and scripts. Everything below is verified against the official Command Line Options documentation.

Quick Examples

Capture2Text_CLI.exe --screen-rect "400 200 600 300"
Capture2Text_CLI.exe --vertical -l "Chinese - Simplified" -i img1.png
Capture2Text_CLI.exe -i img1.png -i img2.jpg -o result.txt
Capture2Text_CLI.exe -l Japanese -f "C:\Temp\image_files.txt"
Capture2Text_CLI.exe --show-languages

Input Options

  • -i, --image <file> — image file to OCR. Repeat the flag for multiple files (-i a.png -i b.jpg).
  • -f, --images-file <file> — text file with one image path per line; OCRs them all in order.
  • -s, --screen-rect "<x1 y1 x2 y2>" — OCR a rectangle of the screen defined by two corner coordinates.

Language & Text Options

  • -l, --language <language> — OCR language, case-sensitive. Default is "English". Use the exact display names — run --show-languages to list what is installed (e.g. -l "Chinese - Simplified", -l Japanese).
  • -w, --show-languages — list installed languages usable with --language.
  • -t, --vertical — OCR vertical text (otherwise horizontal is assumed). Essential for vertical Japanese/Chinese columns.
  • -b, --line-breaks — keep line breaks in the output instead of stripping them.
  • --whitelist "<chars>" / --blacklist "<chars>" — restrict the OCR engine to (or exclude) specific characters, e.g. --whitelist "0123456789" for digit-only captures.

Output Options

  • -o, --output-file <file> — write OCR text to a file; without it, text goes to stdout (pipe it anywhere).
  • --output-file-append — append instead of overwriting when using -o.
  • --clipboard — also send the OCR text to the clipboard.
  • --output-format <format> — custom format with tokens: ${capture} (OCR text), ${linebreak}, ${tab}, ${timestamp}, ${file}. Default: "${capture}${linebreak}". Example: --output-format "${file}: ${capture}${linebreak}" prefixes every result with its source.

Preprocessing Options

  • --trim-capture — trim the capture to foreground pixels and add a thin border; accuracy becomes more consistent.
  • --deskew — compensate for slanted/tilted text during preprocessing.
  • --scale-factor <factor> — preprocessing scale, range 0.71–5.0, default 3.5. Raising it can help tiny text; lowering it can help huge text.
  • --tess-config-file <file> — advanced: pass a custom Tesseract config file.

Debugging & Info

  • -d, --debug — save the captured and pre-processed images so you can see what the OCR engine saw.
  • --debug-timestamp — append a timestamp to debug images.
  • -v, --version — print version info. -?, -h, --help — print the help text above.

The GUI’s One Command Line Option: –portable

For Capture2Text.exe (not the CLI), one extra flag exists: --portable makes it store its .ini settings file in the same directory as the .exe instead of %appdata%\Capture2Text. Create a shortcut with this flag for a fully self-contained, USB-friendly install — details in our portable guide.

Practical Recipes

Batch-OCR a folder of screenshots

dir /b C:\Screens\*.png > list.txt
Capture2Text_CLI.exe -f list.txt -o results.txt --output-file-append

OCR a fixed screen region every run

Capture2Text_CLI.exe --screen-rect "100 100 900 300" --clipboard -l English

Combine the CLI with Task Scheduler or an AutoHotkey script for hands-free OCR. New to Capture2Text? Start with the installation guide or browse all guides.

Frequently Asked Questions

What is Capture2Text_CLI.exe?

It is the command-line sibling of the GUI Capture2Text.exe. It OCRs image files or a rectangle of the screen and prints the result to stdout or a file — no hotkeys, no capture box, no GUI. It lives in the same folder as Capture2Text.exe.

How do I OCR a screenshot from the command line?

Use –screen-rect with coordinates: Capture2Text_CLI.exe –screen-rect “400 200 600 300” OCRs the rectangle from (400,200) to (600,300) and prints the text. Add -o result.txt to save it to a file instead.

How do I OCR multiple images at once?

Repeat -i for each file: Capture2Text_CLI.exe -i img1.png -i img2.jpg -o result.txt. Or put one image path per line in a text file and pass it with -f images.txt.

How do I set the OCR language in the CLI?

With -l / –language, case-sensitive, e.g. -l “Chinese – Simplified” or -l Japanese. Run Capture2Text_CLI.exe –show-languages to list the language names installed on your machine.

Can the GUI Capture2Text.exe take command line options?

One: –portable. Launching Capture2Text.exe –portable stores the .ini settings file next to the .exe instead of %appdata%\Capture2Text — the key to a truly portable setup. See our portable guide.

Does the CLI support vertical text?

Yes: pass -t / –vertical to OCR vertical text (e.g. traditional Chinese/Japanese columns). Combine with –trim-capture, –deskew and –scale-factor to tune preprocessing for difficult images.