Skip to main content

pil_resize

PyPI - package version PyPI - license PyPI - python version PyPI - downloads

GitHub - last commit GitHub - commit activity

GitHub - code size in bytes GitHub - repo size GitHub - lines of code

GitHub - license

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

Metadata

Release files for pil-resize-aspect-ratio 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pil-resize-aspect-ratio 0.0.8
File Size Uploaded
pil_resize_aspect_ratio-0.0.8.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pil-resize-aspect-ratio 0.0.8
File Interpreter ABI Platform
pil_resize_aspect_ratio-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 7.9 kB

Release files / pil_resize_aspect_ratio-0.0.8.tar.gz

Download URL pil_resize_aspect_ratio-0.0.8.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6fad3b2d3cd0b627fc7d0cd8f4cb8f4f10b9e785ac6b8e3dc635374b6d82bc37
BLAKE2b-256 checksum
How to use checksums
568dfede3420dd3c0ca7677da1cd66d7d3bb1254ff2764cae4b4d362711610b3
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pil_resize_aspect_ratio-0.0.8-py3-none-any.whl

Download URL pil_resize_aspect_ratio-0.0.8-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f981265f9830830e85cf768cf93a9a3bbf5db7c4ea3e6337b43541973983267e
BLAKE2b-256 checksum
How to use checksums
63d7e8147e5406fcc4a1c436a7a330d975f7dba0451c32126e885ac4561d485e
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page