Skip to main content

Cleans photographed documents for improved printing

Project description

print-clean

This script helps prepare photographed documents for printing:

Before:

before

After:

after

Installation

Install Python 3.9 or higher, then run:

pip install printclean

or

pip3 install printclean

Usage

printclean path-to-image [path-to-another-image ...] [--level value] [--lang code1 code2 ...]

You can optionally specify the cleanup’s threshold value with --level. The value must be an integer between 0 and 255, inclusive. Larger values produce images with fewer filled pixels. The default is 10.

You may also provide your document’s language(s) with the --lang parameter, which may help fix the input image’s perspective. Currently, the script can only perform simple rotations.

You can find available languages and their codes here. You might need to specifically install your required language for the Tesseract OCR engine (Windows, Ubuntu, Mac OS).

The output image will be saved as a PNG file with the suffix -cleaned.

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

printclean-1.0.0.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

printclean-1.0.0-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

Supported by

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