Image processing library for Python with animated GIFs support
Project description
Image processing library for Python with animated GIFs support - proxy wrapper around Pillow library with simple usable interface and access to each frame.
Features
Attributes:
exif - dict with EXIF tags and GPS dict with GPS tags if presented
mode_desc - image mode description
frame_count - frame count
animated - flag, which shows if image is animated
frames - frame list
Methods:
load - gets called when you access frames attribute for the first time or call any processing or save method, call this method explicitly to load all or limited number of frames (first n frames or random n frames without reordering)
save - save image
close - close image
Requirements
Python 3.5+
Pillow 4.1.1+
Setup
python-3.6 -m venv .env
source .env/bin/activate
pip install imgpy
Usage
from imgpy import Img
# Crop image
with Img(fp='test.gif') as im:
im.crop(box=(10, 10, 110, 110))
im.save(fp='crop.gif')
# Create thumbnail image
with Img(fp='test.gif') as im:
im.thumbnail(size=(100, 100))
im.save(fp='thumb.gif')
# Save 10 random GIF frames
with Img(fp='test.gif') as im:
im.load(limit=10, first=False)
im.save(fp='random.gif')
Tests
Run tests: py.test
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
File details
Details for the file imgpy-1.1.0.tar.gz
.
File metadata
- Download URL: imgpy-1.1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae154ec31f4b095ad5acb8ed7165e5f1c13b96768d998f322498382afa1abc13 |
|
MD5 | 36b16170c5fbc51885a625814a848bd0 |
|
BLAKE2b-256 | 651e7f8cdfc3072438a16c433b4adf4a421eb3b4a47dcf28efe44858b2c79fcd |
File details
Details for the file imgpy-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: imgpy-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f04b0911da0f1b44a17f54bbc3358f8e4cf62144ece8238222b8f54a429b1e0 |
|
MD5 | 6f60337d0ac1378db42645c3dafd6c14 |
|
BLAKE2b-256 | 062f11b168eb9a71762f12dc7fff292d5f28c839cd058b825ace3eeba0257dd6 |