Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Tesseract Bridge Laravel Package

bicycle/tesseract-bridge

PHP wrapper for Tesseract OCR with CLI and FFI backends. Configure the Tesseract binary, list available languages, and recognize text from images via a simple API. Tested on FreeBSD/Debian/Ubuntu with Tesseract 3/4.

View on GitHub
Deep Wiki
Context7

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

:bangbang: 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

example

  • 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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor