Created
September 7, 2025 19:17
-
-
Save igmrrf/45b976b7401cd30287edabe2bb19f9f1 to your computer and use it in GitHub Desktop.
Extract text from image on fish shell using tesseract
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
| #!/usr/bin/env fish | |
| # Check if folder path is provided | |
| if not set -q argv[1] | |
| echo "Usage: ./extract_all.fish <folder-path>" | |
| exit 1 | |
| end | |
| set folder $argv[1] | |
| # Loop over image files and extract text | |
| for file in $folder/*.{png,jpg,jpeg} | |
| if test -f $file | |
| echo "Processing: $file" | |
| tesseract $file - -l eng | |
| echo "" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment