Last active
January 19, 2025 16:28
-
-
Save sebastianrothbucher/9be7d59fe64693e063069f705571c145 to your computer and use it in GitHub Desktop.
img2txt - clipboard image to clipboard text (per se: on Mac)
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
#!/bin/zsh | |
/opt/homebrew/bin/python3 -c 'import pytesseract; from PIL import Image, ImageGrab; im = ImageGrab.grabclipboard(); pytesseract.pytesseract.tesseract_cmd = "/opt/homebrew/bin/tesseract"; print(pytesseract.image_to_string(im))' | pbcopy # python3.12 for specific python | |
# done |
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
#!/bin/bash | |
brew install python3 # only if you didn't already | |
brew install tesseract | |
pip3 install pillow pytesseract --break-system-packages # or create a venv; pip3.12 for specific python | |
# (done) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment