cropy : Python content based image crop
Command line tool and module to crop an image to a specific resolution removing less important parts first.
First started with the approch of this publication but seems a bit complex and slow (http://research.microsoft.com/en-us/um/people/jiansun/papers/SalientDetection_CVPR07.pdf).
cropy uses entropy information to identify slices of the image with less informations.
Usage
To use with command line:
cropy -i [input image] -r [width] [height] -o [output name] -s [maxSteps]
input image : location of the image to crop
width, eight : dimensions of the resultant cropped image
output name : name of the output image (default : original_name.width.eight.orginal_extension)
maxSteps : number of iteration : greater means more precision but slower (default : 10)
More info and examples on http://blog.mapado.com/cropy-how-to-crop-an-image-keeping-the-best-content/
Installation
You can install cropy using pip:
$ pip install cropy
Note that cropy requires scikit-learn, which itself is based on numpy and scipy and requires cython to compile.
Possible upgrade
locate faces inside image to prevent removing
locate text on images to crop first
Thanks
Inspired from slycrop (php entropy based crop) : https://github.com/stojg/slycrop
Metadata
Release files for cropy 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cropy-0.3.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cropy-0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / cropy-0.3.tar.gz
| Download URL | cropy-0.3.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a457eccfdf31a4c4673da5c62ea7fbce6096f52d23dfad9703c120a11439f19
|
|
BLAKE2b-256 checksum How to use checksums |
cb924364ae2d429107ae8304e63305592ec87df5262bdd478428ee84fdd1437c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.3
|
Release files / cropy-0.3-py3-none-any.whl
| Download URL | cropy-0.3-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8505eeed04b4f82b20d08f4b26c421a2fbe9fd5ba9ddd809f9db71931fa7c1a2
|
|
BLAKE2b-256 checksum How to use checksums |
ab8b374e6bf83d114065c55d89e279bb2be80f9d386f7aa35ca1cda257f851dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.3
|