Skip to main content

A CLI tool to extract text from images using OCR

Project description

img2text-cli

A powerful command-line tool to extract text from images using OCR (Optical Character Recognition).

Features

  • 🖼️ 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

Installation

From PyPI (Recommended)

pip install img2text-cli

Prerequisites

This tool requires Tesseract OCR to be installed on your system. For detailed installation instructions, visit the official Tesseract installation guide.

Usage

Basic Usage

Extract text from an image file:

img2text image.png

Piping Images

Process images from stdin:

cat image.png | img2text

Clipboard Image

Extract text from an image in your clipboard:

img2text --clip

Help

Get help and see all options:

img2text --help

Examples

# 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 {}

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the GNU General Public License v3 (GPLv3) - see the LICENSE file for details.

Acknowledgments

  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

img2text_cli-0.1.4.tar.gz (51.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

img2text_cli-0.1.4-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file img2text_cli-0.1.4.tar.gz.

File metadata

  • Download URL: img2text_cli-0.1.4.tar.gz
  • Upload date:
  • Size: 51.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.13

File hashes

Hashes for img2text_cli-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0a4fa60418748e9c2c046b8df6f99e683b1eacba879cca5702b3dadb92f8fa3b
MD5 736274851394d4629f1dd732b80ecab3
BLAKE2b-256 ae2306e55ffc1491b69a748716133d91f759c2791322664d85911bb12cea29f9

See more details on using hashes here.

File details

Details for the file img2text_cli-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for img2text_cli-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d22c7b350501964481bf5051ec113d25914df623e962975509755f962f84ebbc
MD5 60bca15a98aec33d16151ff1f92225a6
BLAKE2b-256 63b6b763bab94c69f3f9bd9f206f733b0c21c1cac1aa244533cb140f78b5c3f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page