> For the complete documentation index, see [llms.txt](https://nagara.gitbook.io/myphp-tools/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nagara.gitbook.io/myphp-tools/image.md).

# image

## IMG Class

IMG class adalah class khusus untuk optical character recognition, dibangun menggunakan teserract ocr php, tesseract OCR Enggine sendiri merupakan software Open source yang dikembangkan oleh google team dengan bahasa c++ . reference :

* <https://opensource.google/projects/tesseract>
* <https://github.com/tesseract-ocr/tesseract>
* <https://github.com/thiagoalessio/tesseract-ocr-for-php>

#### Note

disini saya menggunakan windows sebagai OS, jadi saya termasuk windows users, untuk temen temen lain yang ingin menggunakan OCR wajib menginstall capture2text version 3.9 recommend menggunakan chocolately packages for windows. selengkapnya bisa read di sini

*full doc about tesseract ocr for php*

* <https://github.com/thiagoalessio/tesseract-ocr-for-php#-note-for-windows-users>

*for install choco*

* <https://chocolatey.org/install>

*install used administrative powershell*

```
choco install capture2text --version 3.9
```

*file test* untuk file test bisa di check di halaman ini

* [image test](https://github.com/naagaraa/metode-skriphit/tree/main/src/example/image)

### basic usage

```php
use Nagara\Src\Img\ImgParser;

// create object
$img = new ImgParser;

// put path image file
$img->parseFile("indonesia.jpg"); # default no lang
$img->parseFile("germany.jpg", "deu"); # spesific lang


// print lang support
$img->printLangSupport();

// print about this tool
$img->printAbout();
```

recognition type : ini akan memakan waktu untuk mengenali text secara random

```php
use Nagara\Src\Img\ImgParser;

$img = new ImgParser;
$img->parseFile("english.jpg", "recognition");
```

### language support :

1. deu
2. eng
3. fra
4. ita
5. jpn
6. spa


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nagara.gitbook.io/myphp-tools/image.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
