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)
```
========================================
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
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
Close
Hashes for python-image-resize-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e1db0235fb021f120037d0e012f5994f1238a9e791214edf9016f8685ddb200 |
|
MD5 | 17236eb64927b6d05107357b8bdbfdad |
|
BLAKE2b-256 | 7ab5143e8846e293a782e42f6e9f6c33a1ed4f95c5c3fb20843848f4f55ed8dc |
Close
Hashes for python_image_resize-0.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41bc336b63ed5c66ceb53d4cb71b7d21fe8c3e800afefbe7ab69ec442fc93808 |
|
MD5 | 5ca5ca2912aa57b8e647f1a70854a854 |
|
BLAKE2b-256 | 3209ebd7348e948a233410996568d30480d005a4f938bc789d37c83e424f6281 |