https://github.com/insidegui/ocrit
Simple command-line utility for performing OCR using Apple's Vision framework
https://github.com/insidegui/ocrit
Last synced: about 1 month ago
JSON representation
Simple command-line utility for performing OCR using Apple's Vision framework
- Host: GitHub
- URL: https://github.com/insidegui/ocrit
- Owner: insidegui
- License: bsd-2-clause
- Created: 2022-05-05T17:59:12.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-15T11:48:17.000Z (about 1 year ago)
- Last Synced: 2026-01-22T09:26:25.380Z (2 months ago)
- Language: Swift
- Size: 137 KB
- Stars: 169
- Watchers: 3
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ocrit
Runs Vision's OCR on input images or PDF files and outputs corresponding `txt` files for each image, or writes the recognized results to standard output.
```
USAGE: ocrit [ ...] [--output ] [--language ...] [--fast]
ARGUMENTS:
Path or list of paths for the images
OPTIONS:
-o, --output Path to a directory where the txt files will be written to, or - for standard output (default: -)
-l, --language
Language code to use for the recognition, can be repeated to select multiple languages
-f, --fast Uses an OCR algorithm that prioritizes speed over accuracy
-h, --help Show help information.
```
## Language Selection
The `--language` (or `-l`) option can be used to indicate which language or languages will be used for OCR.
Multiple languages can be specified by repeating the option, example:
```
ocrit path/to/image.png -l ko-KR -l en-US
```
The order of the languages is important, as Vision's OCR engine will attempt to perform OCR using the languages in order. In my experience, if you have an image or document that contains a mix of English and some other language, it's best to specify `en-US` as the **last** language on the list.
### Supported Languages
Language support varies with the version of macOS and whether or not the `--fast` flag is specified.
This is the current list of supported languages as of macOS 14.4:
```
en-US, fr-FR, it-IT, de-DE, es-ES, pt-BR, zh-Hans, zh-Hant, yue-Hans, yue-Hant, ko-KR, ja-JP, ru-RU, uk-UA, th-TH, vi-VT
```
This is the current list of supported languages as of macOS 14.4, with the `--fast` flag enabled:
```
en-US, fr-FR, it-IT, de-DE, es-ES, pt-BR
```