pil_resize
Project description
pil_resize
Description
Resize/paste images easily keeping their aspect ratio
Install
pip install pil_resize_aspect_ratio
# or
pip3 install pil_resize_aspect_ratio
Usage
from pil_resize_aspect_ratio import Resizer, FillType
p_org_img_bg = 'bg.png'
p_overlay_img = 'fg.png'
path_out = 'final.png'
resized_bg_image = Resizer.resize_keep_aspect_ratio(
image=p_org_img_bg,
fill_type=FillType.Fill,
target_size=(1920, 1080),
return_image_instead_of_success=False
)
print(
Resizer.paste_and_fit(
background_image=resized_bg_image,
foreground_image=p_overlay_img,
path_out=path_out
)
)
Dependencies
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
Built Distribution
File details
Details for the file pil_resize_aspect_ratio-0.0.8.tar.gz
.
File metadata
- Download URL: pil_resize_aspect_ratio-0.0.8.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fad3b2d3cd0b627fc7d0cd8f4cb8f4f10b9e785ac6b8e3dc635374b6d82bc37 |
|
MD5 | e34bbe8ce8bbda436d73a22644942ff3 |
|
BLAKE2b-256 | 568dfede3420dd3c0ca7677da1cd66d7d3bb1254ff2764cae4b4d362711610b3 |
File details
Details for the file pil_resize_aspect_ratio-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: pil_resize_aspect_ratio-0.0.8-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f981265f9830830e85cf768cf93a9a3bbf5db7c4ea3e6337b43541973983267e |
|
MD5 | efd5ab0f67d07140fc1942c43e755b28 |
|
BLAKE2b-256 | 63d7e8147e5406fcc4a1c436a7a330d975f7dba0451c32126e885ac4561d485e |