Compare commits
1 Commits
master
...
dependabot
Author | SHA1 | Date |
---|---|---|
dependabot[bot] | 249ab776f7 | 2 years ago |
6 changed files with 45 additions and 44 deletions
@ -1,18 +1,17 @@ |
|||||||
# Image Format |
# Image Format |
||||||
|
|
||||||
The main Tesseract.js functions (ex. recognize, detect) take an `image` parameter. The image formats and data types supported are listed below. |
Support Format: **bmp, jpg, png, pbm** |
||||||
|
|
||||||
Support Image Formats: **bmp, jpg, png, pbm, webp** |
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. |
||||||
|
|
||||||
For browser and Node, supported data types are: |
On a browser, an image can be: |
||||||
- string with base64 encoded image (fits `data:image\/([a-zA-Z]*);base64,([^"]*)` regexp) |
- an `img` or `canvas` element |
||||||
- buffer |
- 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 |
||||||
|
|
||||||
For browser only, supported data types are: |
In Node.js, an image can be |
||||||
- `File` or `Blob` object |
- a path to a local image |
||||||
- `img` or `canvas` element |
- a Buffer storing binary image |
||||||
|
- a base64 encoded image fits `data:image\/([a-zA-Z]*);base64,([^"]*)` regexp |
||||||
For Node only, supported data types are: |
|
||||||
- string containing a path to local image |
|
||||||
|
|
||||||
Note: images must be a supported image format **and** a supported data type. For example, a buffer containing a png image is supported. A buffer containing raw pixel data is not supported. |
|
||||||
|
Loading…
Reference in new issue