Skip to content

Instantly share code, notes, and snippets.

@igmrrf
Created September 7, 2025 19:17
Show Gist options
  • Select an option

  • Save igmrrf/45b976b7401cd30287edabe2bb19f9f1 to your computer and use it in GitHub Desktop.

Select an option

Save igmrrf/45b976b7401cd30287edabe2bb19f9f1 to your computer and use it in GitHub Desktop.
Extract text from image on fish shell using tesseract
#!/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