Last updated:
0 purchases
pilresizeaspectratio 0.0.8
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
noraise, Pillow
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.