A collection of useful tools for python pillow and ffmpy
Project description
pillow-tools
A collection of useful tools for python pillow and ffmpy.
Install
pip install pillow-tools
Create a thumbnail
You can create a smaller version of an image (including .gif) while maintaining the aspect ratio.
from pillow_tools import OptimizeToSize imagePath = '/dir/image.png' thumbPath = OptimizeToSize(imagePath, maxWidth=1280, maxHeight=720) # The thumbPath image is now in the same directory as imagePath. # This will scale the image to a new resolution not exceeding the maxWidth/maxHeight but preserving the aspect ratio print('thumbPath=', thumbPath)
Output
>>> thumbPath= '/dir/image_1280x720.png'
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
pillow_tools-1.1.2.tar.gz
(4.1 kB
view details)
Built Distribution
File details
Details for the file pillow_tools-1.1.2.tar.gz
.
File metadata
- Download URL: pillow_tools-1.1.2.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2ee8c724a00b16ed807b843e6b4c57634d8657a595a6eaeefc59a56cfdd602c |
|
MD5 | 1547b008de768cf8a18f3197c2a23a95 |
|
BLAKE2b-256 | d6aa481c8b6e6cd976af8b24dafdf2297b4d7418dedcb38f5e86944bc829e3e2 |
File details
Details for the file pillow_tools-1.1.2-py3-none-any.whl
.
File metadata
- Download URL: pillow_tools-1.1.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95ac69fd4be605c121b6e0900c326ba43f975924e481271551047990ba1965da |
|
MD5 | 72692e66bff0e2314016e340169e6237 |
|
BLAKE2b-256 | 078f7d4c4a7b79a45dad62f8a4641c8e05293922ee3cbc49a4defe99538aae44 |