Skip to main content

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

Metadata

Release files for img2text-cli 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for img2text-cli 0.1.7
File Size Uploaded
img2text_cli-0.1.7.tar.gz 51.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for img2text-cli 0.1.7
File Interpreter ABI Platform
img2text_cli-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 54.5 kB

Release files / img2text_cli-0.1.7.tar.gz

Download URL img2text_cli-0.1.7.tar.gz
Size 51.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ca5ff5ea1c2c7c07a8a758151c1d2a62f498c0bfb69acafd683ae1f4247e9e15
BLAKE2b-256 checksum
How to use checksums
12d11b9a33c20151f8a9de4d13980ba21469531e0adf72801faf2545a2b086b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.13

Release files / img2text_cli-0.1.7-py3-none-any.whl

Download URL img2text_cli-0.1.7-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b939955bf0c084dff7759cdad7fed3a5b5c6c67ff6b5b369790f88f12a7adbd5
BLAKE2b-256 checksum
How to use checksums
977236829a1543721a0f2a508215b39088b8c1a42ec9f80fc9831a0ead768d6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.13

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page