Welcome to mirror list, hosted at ThFree Co, Russian Federation.

image-format.md « docs - github.com/naptha/tesseract.js.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b9410dd2bec922ba613920ad452e26a9703686f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Image Format

Support Format: **bmp, jpg, png, pbm**

The main Tesseract.js functions (ex. recognize, detect) take an `image` parameter, which should be something that is like an image. What's considered "image-like" differs depending on whether it is being run from the browser or through NodeJS.

On a browser, an image can be:
- an `img`, `video`, or `canvas` element
- a `File` object (from a file `<input>`)
- a `Blob` object
- a path or URL to an accessible image
- a base64 encoded image fits `data:image\/([a-zA-Z]*);base64,([^"]*)` regexp

In Node.js, an image can be
- a path to a local image
- a Buffer storing binary image 
- a base64 encoded image fits `data:image\/([a-zA-Z]*);base64,([^"]*)` regexp