Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kkristof200/py_resize_image
https://github.com/kkristof200/py_resize_image
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kkristof200/py_resize_image
- Owner: kkristof200
- License: mit
- Created: 2021-03-04T15:51:47.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-10T13:39:21.000Z (almost 4 years ago)
- Last Synced: 2025-01-23T01:18:09.850Z (27 days ago)
- Language: Python
- Size: 3.15 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pil_resize







## Description
Resize/paste images easily keeping their aspect ratio
## Install
~~~~bash
pip install pil_resize_aspect_ratio
# or
pip3 install pil_resize_aspect_ratio
~~~~## Usage
~~~~python
from pil_resize_aspect_ratio import Resizer, FillTypep_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](https://pypi.org/project/noraise), [Pillow](https://pypi.org/project/Pillow)