bicycle/tesseract-bridge
Integration of tesseract bridge via FFI and CLI
Maintainers
Requires
- php: >7.4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.17.3
- phing/phing: dev-master
- phpmd/phpmd: ^2.9.1
- phpunit/phpunit: ^9.5.0
- sebastian/phpcpd: ^6.0.3
- squizlabs/php_codesniffer: ^3.5.8
- vimeo/psalm: ^4.3.2
Suggests
- ext-ffi: So you can use tesseract via ffi integration
Provides
None
Conflicts
None
Replaces
None
MIT 93b360cf4ea7b93b25120fbcfadc668c3bf58303
This package is auto-updated.
Last update: 2026-06-08 18:26:17 UTC
README
A wrapper to work with Tesseract OCR inside PHP via CLI and/or FFI interfaces.
👁 Minimum PHP Version
👁 Build Status
👁 Codacy Badge
👁 codecov
👁 Scrutinizer Code Quality
👁 Latest stable version on packagist
👁 Total downloads
👁 Monthly downloads
👁 License
‼️ Tested only on FreeBSD, Debian and Ubuntu platforms with Tesseract OCR version 3 and 4 (see build logs).
Installation
Via Composer:
$ composer require bicycle/tesseract-bridge
Usage
Basic usage
-
CLI ```php use Bicycle\Tesseract\Bridge as TesseractBridge;
$configuration = TesseractBridge\Configuration(['binary_path' => 'tesseract']); $bridge = new TesseractBridge\CLI($configuration); echo $bridge->testGetVersion(); print_r($bridge->getAvailableLanguages()); echo $bridge->recognizeFromFile('eurotext.png'); // Set proper path here ``` -
FFI ```php use Bicycle\Tesseract\Bridge as TesseractBridge;
$configuration = TesseractBridge\Configuration(['binary_path' => 'tesseract']); $bridge = new TesseractBridge\FFI($configuration); echo $bridge->testGetVersion(); print_r($bridge->getAvailableLanguages()); echo $bridge->recognizeFromFile('eurotext.png'); // Set proper path here ```
With languages
-
CLI ```php use Bicycle\Tesseract\Bridge as TesseractBridge;
$configuration = TesseractBridge\Configuration(['binary_path' => 'tesseract']); $bridge = new TesseractBridge\CLI($configuration); echo $bridge->testGetVersion(); print_r($bridge->getAvailableLanguages()); echo $bridge->recognizeFromFile('eurotext.png', ['deu']); // Set proper path here ``` -
FFI ```php use Bicycle\Tesseract\Bridge as TesseractBridge;
$configuration = TesseractBridge\Configuration(['binary_path' => 'tesseract']); $bridge = new TesseractBridge\FFI($configuration); echo $bridge->testGetVersion(); print_r($bridge->getAvailableLanguages()); echo $bridge->recognizeFromFile('eurotext.png', ['deu']); // Set proper path here ```
How to contribute
You can contribute to this project by:
- Opening an Issue if you found a bug or wish to propose a new feature;
- Opening PR if you want to improve/create/fix something
Additional
Please check our FAQ
License
tesseract-bridge is released under the MIT License.
