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: 10 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 (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-03-10T13:39:21.000Z (over 3 years ago)
- Last Synced: 2024-10-31T14:29:56.858Z (15 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
![PyPI - package version](https://img.shields.io/pypi/v/pil_resize?logo=pypi&style=flat-square)
![PyPI - license](https://img.shields.io/pypi/l/pil_resize?label=package%20license&style=flat-square)
![PyPI - python version](https://img.shields.io/pypi/pyversions/pil_resize?logo=pypi&style=flat-square)
![PyPI - downloads](https://img.shields.io/pypi/dm/pil_resize?logo=pypi&style=flat-square)![GitHub - last commit](https://img.shields.io/github/last-commit/kkristof200/py_resize_image?style=flat-square)
![GitHub - commit activity](https://img.shields.io/github/commit-activity/m/kkristof200/py_resize_image?style=flat-square)![GitHub - code size in bytes](https://img.shields.io/github/languages/code-size/kkristof200/py_resize_image?style=flat-square)
![GitHub - repo size](https://img.shields.io/github/repo-size/kkristof200/py_resize_image?style=flat-square)
![GitHub - lines of code](https://img.shields.io/tokei/lines/github/kkristof200/py_resize_image?style=flat-square)![GitHub - license](https://img.shields.io/github/license/kkristof200/py_resize_image?label=repo%20license&style=flat-square)
## 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)