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

github.com/naptha/tesseract.js.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalearica <admin@scribeocr.com>2022-09-21 03:42:16 +0300
committerGitHub <noreply@github.com>2022-09-21 03:42:16 +0300
commitc9200839dfcbdc20df82daa6c6a1b0cd4bb9ae21 (patch)
tree5a6d73df360e4bd802530a79c3b960c581b2e57f
parent1b87e30ae3f8b8c2bcac40dc8f017ec082fcb9f3 (diff)
Clarified image format documentation per #359 (#670)
-rw-r--r--docs/image-format.md25
1 files changed, 13 insertions, 12 deletions
diff --git a/docs/image-format.md b/docs/image-format.md
index 6b822ee..8f72f8d 100644
--- a/docs/image-format.md
+++ b/docs/image-format.md
@@ -1,17 +1,18 @@
# Image Format
-Support Format: **bmp, jpg, png, pbm**
+The main Tesseract.js functions (ex. recognize, detect) take an `image` parameter. The image formats and data types supported are listed below.
-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.
+Support Image Formats: **bmp, jpg, png, pbm, webp**
-On a browser, an image can be:
-- an `img` 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
+For browser and Node, supported data types are:
+ - string with base64 encoded image (fits `data:image\/([a-zA-Z]*);base64,([^"]*)` regexp)
+ - buffer
-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
+For browser only, supported data types are:
+ - `File` or `Blob` object
+ - `img` or `canvas` element
+
+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. \ No newline at end of file