Auto-crop images
Project description
Py-Cropper
Py-Cropper is a Typer-powered command-line utility that trims uniform white borders from common bitmap formats using Pillow. It can process single files, batches and (on Windows) integrates with File Explorer via a right-click verb.
Requirements
- Python 3.8+
- Pillow and Typer (installed automatically when using
pip install) - Windows is only required for the optional context-menu verb
Installation
# Install from PyPI (preferred)
pip install py-cropper
# ...or install from a local clone
git clone https://github.com/mr-szgz/py-cropper.git
cd py-cropper
pip install .
The installer registers a cropper console entry point. On Windows it will also attempt to add the File Explorer verb automatically when pip install is executed.
Usage
# Crop a single file (writes <name>-cropped.<ext> by default)
cropper example.png
# Force the output path
cropper example.png --output clean.png
# Process several files and log errors individually
cropper image1.jpg image2.jpg
# Process every supported image located next to <seed>.png
cropper seed.png --include-siblings
# Keep more of the light border by increasing tolerance (0-255)
cropper scan.png --tolerance 230
CLI help is always available with cropper --help or cropper --help.
Windows File Explorer Shell Extension
Building Extension
dotnet build
Registering in Context Menu
Run the helper from an elevated PowerShell prompt inside dotnet/ (ensure cropper.exe is already on your PATH):
cd dotnet
.\shell.ps1 -Action Register -Configuration Release
This builds the COM host and wires up the Explorer verb. To remove it later run:
.\shell.ps1 -Action Unregister
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycropper-0.1.8.tar.gz.
File metadata
- Download URL: pycropper-0.1.8.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03283e249e376afd372d6e969732635baf53369ad60c3e302b10d54a61cdaeef
|
|
| MD5 |
c32a05497b7773052d46d9f4c9c97e3f
|
|
| BLAKE2b-256 |
52804a58b9c7ad3df416af93a73b4f34036ccf1be526fd7442677b3453ee2833
|
File details
Details for the file pycropper-0.1.8-py3-none-any.whl.
File metadata
- Download URL: pycropper-0.1.8-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bf6f235e9102696e2fe203fab015112d2aefefcfee9d54e808fdc106107ad09
|
|
| MD5 |
c6d02b13c16b8b337dddf2a2cb37bdc5
|
|
| BLAKE2b-256 |
c6b330772b300ee2d9326065f07b236c95d5bb795b421498af9464a860e188ab
|