PHPackages                             timatanga/ocr - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. timatanga/ocr

ActiveLibrary

timatanga/ocr
=============

The timatanga OCR package. OCR processing of images with tesseract ocr

v0.1.0(4y ago)00proprietaryPHPPHP ^8.0

Since Sep 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/timatanga/ocr)[ Packagist](https://packagist.org/packages/timatanga/ocr)[ RSS](/packages/timatanga-ocr/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Optical Character Recognition (OCR)
===================================

[](#optical-character-recognition-ocr)

This package is a wrapper around the the tesseract-ocr () package. This library depends on

- Symfony Process
- Tesseract OCR, version 4 or later.

Installation
------------

[](#installation)

composer require dbizapps/ocr

Dependencies
------------

[](#dependencies)

There are many options to install Tesseract OCR according to your opeerating system needs. Personal experiences are limited to macOS for which you can find a recommendation below. Sorry for this inconveniences.

### macOS

[](#macos)

To install Tesseract OCR with support just for english

```
$ brew install tesseract

```

For a fully fledged language installation you can choose

```
$ brew install tesseract tesseract-lang

```

Basic Usage
-----------

[](#basic-usage)

Creating a recognition engine instance doesn't require further attributes

```
// create ocr instance
$engine = new Recognition;

```

Retrieving tesseract specific information

```
// retrieve tesseract version
$version = $engine->version();

// retrieve supported languages
$lang = $engine->supportedLanguages();

```

Input/Output Configuration
--------------------------

[](#inputoutput-configuration)

The target image can be set while creating a new recognition instance or at a later state

```
$engine = new Recognition();

$engine->setImage();

```

The engine can act in file mode to store results in a given output file and output path Without providing output configuration options the later scan process is streaming results

```
$engine = new Recognition(, , );

```

Custom Configuration
--------------------

[](#custom-configuration)

To get an overview of Tesseract OCR configuration options, please refer to

Configuration options can be set individually like

```
// Scan density
$engine->setConfig(['dpi' => 300]);

// OCR Engine mode.
$engine->setConfig(['oem' => 2]);

// Page segmentation method
$engine->setConfig(['psm' => 10]);

// Languages
$engine->setConfig(['languages' => ['eng', 'fra']]);

// output configuration
$engine->setConfig(['configFile' => ['pdf']]);

```

Supported options for configFile are:

- alto Output in ALTO format (OUTPUTBASE.xml).
- hocr Output in hOCR format (OUTPUTBASE.hocr).
- pdf Output PDF (OUTPUTBASE.pdf).
- txt Output plain text (OUTPUTBASE.txt / default).

Instead of setting options individually there is a global settings method

```
$engine->setConfig([
	'dpi' => 300,
	'oem' => 2,
	'psm' => 10,
	'languages' => ['eng', 'fra'],
	'configFile' => ['pdf'],
])

```

Scan usage
----------

[](#scan-usage)

Scanning an image as simple as

```
$result = $engine->scan()

```

If the output-path and output-filename are set, the provided result represents the path to the scaned output. Otherwise the result respresents the scaned output.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1691d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e85d042af6c9730c747e158b2b03e6876ebc03b3d2bdf5e3fe5e55fe4f6e6b2?d=identicon)[dbizapps](/maintainers/dbizapps)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/timatanga-ocr/health.svg)

```
[![Health](https://phpackages.com/badges/timatanga-ocr/health.svg)](https://phpackages.com/packages/timatanga-ocr)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[temporal/sdk

Temporal SDK

4002.2M18](/packages/temporal-sdk)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[illuminate/process

The Illuminate Process package.

44699.5k65](/packages/illuminate-process)[statamic/cli

Statamic CLI Tool

7587.7k](/packages/statamic-cli)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
