Skip to main content

A Small python package to easily resize images

Project description

A python package to easily resize images
========================================

This package gives function for easily resizing images.

The following functions are supported :

1. resize_cover
2. resize_contain
3. resize_by_width
4. resize_by_height
5. crop


Here is a full example :

```python
from imageresize import imageresize
from cStringIO import StringIO
from PIL import Image

test_img = open('test-image.jpeg', 'rw')

img = Image.open(test_img)
img = imageresize.crop(img, [200, 200])
img.save('test-image-crop.jpeg', img.format)


img = Image.open(test_img)
img = imageresize.resize_cover(img, [200, 100])
img.save('test-image-cover.jpeg', img.format)


img = Image.open(test_img)
img = imageresize.resize_contain(img, [200, 100])
img.save('test-image-contain.jpeg', img.format)


img = Image.open(test_img)
img = imageresize.resize_by_width(img, 200)
img.save('test-image-width.jpeg', img.format)


img = Image.open(test_img)
img = imageresize.resize_by_height(img, 200)
img.save('test-image-height.jpeg', img.format)


img = Image.open(test_img)
img = imageresize.resize_thumbnail(img, [200, 200])
img.save('test-image-thumbnail.jpeg', img.format)
```

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

python-image-resize-0.0.1.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

python_image_resize-0.0.1-py2-none-any.whl (3.3 kB view hashes)

Uploaded Python 2

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