Created
November 25, 2024 09:32
-
-
Save lobster1234/a6400c807683c9a9051742ee5ca9f9f0 to your computer and use it in GitHub Desktop.
Script to extract text from an image file, mostly for screenshots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
from pytesseract import pytesseract | |
img = Image.open(path_to_file) | |
text = pytesseract.image_to_string(img) | |
print(text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
used
brew install tesseract
to install tesseract on MacOS