Skip to content

index ​

Functions ​

readText ​

ts
readText(filepath: string, language: string = "eng"): string

Recognize the text in an image locally with Tesseract. Nothing is uploaded. Slower and less accurate than macOS Vision, but runs on any platform.

Parameters:

NameTypeDefaultDescription
filepathstringPath to a PNG or JPEG image
languagestring"eng"Tesseract language code; only "eng" ships today

Returns: string

(source)