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 hashes)
Built Distribution
Close
Hashes for pillow_tools-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95ac69fd4be605c121b6e0900c326ba43f975924e481271551047990ba1965da |
|
MD5 | 72692e66bff0e2314016e340169e6237 |
|
BLAKE2b-256 | 078f7d4c4a7b79a45dad62f8a4641c8e05293922ee3cbc49a4defe99538aae44 |