print-clean
This script helps prepare photographed documents for printing:
Before:
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> ...] [--method threshold|gauss_blur] [--level value] [--lang <code1> <code2> ...]
You can provide one or more paths to image files. The script will clean them up and save the results in the same directory.
You can specify the cleanup method using the --method parameter. The available methods are threshold and gauss_blur, with the default being gauss_blur.
If the --method is set to threshold, you can optionally specify the threshold value for cleanup using the --level parameter. The value must be an integer between 0 and 255 (inclusive). Larger values produce images with fewer filled pixels. The default value is 10.
Additionally, you may specify the language(s) of your document using the --lang parameter. This can help the script improve perspective correction for the input image. Note that the script currently supports only simple rotations for perspective correction.
You can find the available languages and their corresponding codes here. Depending on your system, you may need to install the required language files for the Tesseract OCR engine: (Windows, Ubuntu, Mac OS).
The output image will be saved as a PNG file with the suffix -cleaned.
Metadata
Release files for printclean 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| printclean-1.1.0.tar.gz | 6.1 kB | Without provenance | Details for printclean-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| printclean-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for printclean-1.1.0-py3-none-any.whl |
Total release size: 12.8 kB
Release files / printclean-1.1.0.tar.gz
| Download URL | printclean-1.1.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c560d74423d70306d319e7338e731b92db3114cc974340678817cc367aa770a8
|
|
BLAKE2b-256 checksum How to use checksums |
57b4e8daf103237b3d7f6765850cf6c07e01faf08c0ea89559903d30df668d96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / printclean-1.1.0-py3-none-any.whl
| Download URL | printclean-1.1.0-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b478dd7e6736c3381c98640ddcdbb5b66d5053af87457b08a3d01a32a8b4b7d
|
|
BLAKE2b-256 checksum How to use checksums |
ac61b9d0c80b47f58f76e8dd8057443ea7d15c514be2e152972c9c13a1950b73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for printclean 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.