Skip to main content

Command line tool and module to crop an image to a specific resolution removing less important parts first

Project description

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

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

cropy-0.3.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

cropy-0.3-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file cropy-0.3.tar.gz.

File metadata

  • Download URL: cropy-0.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for cropy-0.3.tar.gz
Algorithm Hash digest
SHA256 6a457eccfdf31a4c4673da5c62ea7fbce6096f52d23dfad9703c120a11439f19
MD5 e1078780b772f582bc6f1f4d08d8557f
BLAKE2b-256 cb924364ae2d429107ae8304e63305592ec87df5262bdd478428ee84fdd1437c

See more details on using hashes here.

File details

Details for the file cropy-0.3-py3-none-any.whl.

File metadata

  • Download URL: cropy-0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for cropy-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8505eeed04b4f82b20d08f4b26c421a2fbe9fd5ba9ddd809f9db71931fa7c1a2
MD5 fc93a42e07f3584103df7cebc815422b
BLAKE2b-256 ab8b374e6bf83d114065c55d89e279bb2be80f9d386f7aa35ca1cda257f851dc

See more details on using hashes here.

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