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.1.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for pillow_tools-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1ff46ad226d1e0da21d9efc7a672cb4389aaf56baa903e48c996e9d64a3e314 |
|
MD5 | bbc9e8c5b2cf23f441a401f4cd160214 |
|
BLAKE2b-256 | 11199ce0d45d400a238b79345359b58888dff2f6ac911e9f2bef67c79995450a |