A powerful command-line tool to extract text from images using OCR (Optical Character Recognition).
- 🖼️ Image to Text: Convert image files to text using Tesseract OCR
- 📋 Clipboard Support: Extract text directly from clipboard images
- 🔄 Piping Support: Process images from stdin for automation
- ⚡ Fast & Efficient: Built with Python and optimized for performance
- 🎯 Simple CLI: Easy-to-use command-line interface
pip install img2text-cliThis tool requires Tesseract OCR to be installed on your system. For detailed installation instructions, visit the official Tesseract installation guide.
Extract text from an image file:
img2text image.pngProcess images from stdin:
cat image.png | img2textExtract text from an image in your clipboard:
img2text --clipGet help and see all options:
img2text --help# Extract text from a local image file
$ img2text document.png
This is the extracted text from the image...
# Process clipboard image
$ img2text --clip
# Text is automatically copied to clipboard
# Use with other tools
$ ls *.png | xargs -I {} img2text {}Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the GNU General Public License v3 (GPLv3) - see the LICENSE file for details.
- Tesseract OCR - The OCR engine
- Click - Command line interface creation kit
- Pillow - Python Imaging Library
- pyperclip - Cross-platform clipboard operations for text
- pyperclipimg - Cross-platform clipboard operations for images