Read text from image
Extract text from an image file (PNG, JPG, TIFF, BMP) or a PDF, or from a region of an image, optionally keeping only the text between two markers.
Command in the OCR toolkit · id ooa.ocr/read_image · 14 inputs (1 required), 1 output
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Path | File | Yes | Image file. | |
| Language | String | No | eng | Tesseract language(s), e.g. eng, deu or eng+fra. |
| Page mode | Number | No | 3 | Page layout mode: 3 automatic, 6 single block, 7 single line, 11 sparse text. |
| After text | String | No | Keep only the text after the first occurrence of this marker, e.g. Invoice number:. | |
| Before text | String | No | Keep only the text before this marker (searched after the after_text marker). | |
| Trim | Boolean | No | true | Remove spaces and line breaks at the start and end of the result. |
| Scale | Number | No | 1 | Enlarge the image by this factor (1 to 5) before reading; 2 or 3 helps with small text. |
| Image mode | String | No | none | Prepare the image: none, gray, or black_white (a simple threshold that often helps with coloured backgrounds). |
| X | Number | No | Region left in pixels; the whole image when the region is empty. | |
| Y | Number | No | Region top in pixels. | |
| Width | Number | No | Region width in pixels. | |
| Height | Number | No | Region height in pixels. | |
| Password | Credential | No | A PDF's password (G4). | |
| Pages | String | No | A PDF's pages to read, e.g. 1,3,5-7; every page when empty (G4). |
Outputs
| Output | Type | What it is |
|---|---|---|
| text | String | Recognised text. |