All Projects → smartcrop → Smartcrop.py

smartcrop / Smartcrop.py

Licence: mit
smartcrop implementation in Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Smartcrop.py

Tocropviewcontroller
A view controller for iOS that allows users to crop portions of UIImage objects
Stars: ✭ 4,210 (+2265.17%)
Mutual labels:  image-processing, crop-image
Igrphototweaks
Drag, Rotate, Scale and Crop
Stars: ✭ 212 (+19.1%)
Mutual labels:  image-processing, crop-image
Flyimg
Dockerized PHP7 application runs as a Microservice to resize and crop images on the fly. Get optimised images with MozJPEG, WebP or PNG using ImageMagick. Includes face detection, cropping, face blurring, image rotation and many other options. Abstract storage based on FlySystem in order to store images on any provider (local, AWS S3...).
Stars: ✭ 762 (+328.09%)
Mutual labels:  image-processing, crop-image
Imaginary
Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
Stars: ✭ 4,107 (+2207.3%)
Mutual labels:  image-processing, crop-image
Mort
Storage and image processing server written in Go
Stars: ✭ 420 (+135.96%)
Mutual labels:  image-processing, crop-image
Imgproxy
Fast and secure standalone server for resizing and converting remote images
Stars: ✭ 5,688 (+3095.51%)
Mutual labels:  image-processing, crop-image
Smartcircle
✂️Automatically determine where to crop a circular image out of a rectangular.
Stars: ✭ 29 (-83.71%)
Mutual labels:  image-processing, crop-image
Vuejs Clipper
Vue.js image clipping components using Vue-Rx.
Stars: ✭ 161 (-9.55%)
Mutual labels:  crop-image
Pynet Pytorch
Generating RGB photos from RAW image files with PyNET (PyTorch)
Stars: ✭ 169 (-5.06%)
Mutual labels:  image-processing
Open Solution Data Science Bowl 2018
Open solution to the Data Science Bowl 2018
Stars: ✭ 159 (-10.67%)
Mutual labels:  image-processing
Deblurgan
Image Deblurring using Generative Adversarial Networks
Stars: ✭ 2,033 (+1042.13%)
Mutual labels:  image-processing
Pdftabextract
A set of tools for extracting tables from PDF files helping to do data mining on (OCR-processed) scanned documents.
Stars: ✭ 1,969 (+1006.18%)
Mutual labels:  image-processing
Filestack Js
Official Javascript SDK for the Filestack API and content ingestion system.
Stars: ✭ 169 (-5.06%)
Mutual labels:  image-processing
Pngtastic
A pure Java PNG image optimization and manipulation library
Stars: ✭ 159 (-10.67%)
Mutual labels:  image-processing
Zimagecropper
A Swift 5 repo to crop image in any shape.
Stars: ✭ 174 (-2.25%)
Mutual labels:  crop-image
Gan Mri
Code repository for Frontiers article 'Generative Adversarial Networks for Image-to-Image Translation on Multi-Contrast MR Images - A Comparison of CycleGAN and UNIT'
Stars: ✭ 159 (-10.67%)
Mutual labels:  image-processing
Weibo Img Crypto
自动加密解密微博上传的图片
Stars: ✭ 176 (-1.12%)
Mutual labels:  image-processing
Net Vips
.NET binding for libvips
Stars: ✭ 173 (-2.81%)
Mutual labels:  image-processing
Transformers
An Android transformation library providing a variety of image transformations for Coil, Glide, Picasso, and Fresco.
Stars: ✭ 167 (-6.18%)
Mutual labels:  image-processing
Imager
R package for image processing
Stars: ✭ 166 (-6.74%)
Mutual labels:  image-processing

.. image:: https://travis-ci.com/smartcrop/smartcrop.py.svg?branch=master :target: https://travis-ci.com/smartcrop/smartcrop.py

smartcrop.py

smartcrop implementation in Python.

smartcrop finds good crops for arbitrary images and crop sizes, based on Jonas Wagner's smartcrop.js_.

.. _smartcrop.js: https://github.com/jwagner/smartcrop.js

.. image:: https://i.gyazo.com/c602d20e025e58f5b15180cd9a262814.jpg :width: 50%

.. image:: https://i.gyazo.com/5fbc9026202f54b13938de621562ed3d.jpg :width: 25%

.. image:: https://i.gyazo.com/88ee22ca9e1dd7e9eba7ea96db084e5e.jpg :width: 50%

Requirements

  • numpy
  • PIL or Pillow

Installation

.. code-block:: sh

pip3 install smartcrop

or directly from GitHub:

.. code-block:: sh

pip install -e git+git://github.com/hhatto/[email protected]#egg=smartcrop

Usage

Use the basic command-line tool:

.. code-block:: sh

$ smartcroppy --help
usage: smartcroppy [-h] [--debug] [--width WIDTH] [--height HEIGHT]
                   INPUT_FILE OUTPUT_FILE

positional arguments:
  INPUT_FILE       input image file
  OUTPUT_FILE      output image file

optional arguments:
  -h, --help       show this help message and exit
  --debug          debug mode
  --width WIDTH    crop width
  --height HEIGHT  crop height

Processing an image:

.. code-block:: sh

smartcroppy --width 300 --height 300 tests/images/business-work-1.jpg output.jpg --debug-file debug.jpg

Or use the module it in your code (this is a really basic example):

.. code-block:: python

import json
import sys

import smartcrop
from PIL import Image

image = Image.open(sys.argv[1])

sc = smartcrop.SmartCrop()
result = sc.crop(image, 100, 100)
print(json.dumps(result, indent=2))

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].