Skip to main content

pil_resize

Project description

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

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

pil_resize_aspect_ratio-0.0.8.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

pil_resize_aspect_ratio-0.0.8-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

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

Hashes for pil_resize_aspect_ratio-0.0.8.tar.gz
Algorithm Hash digest
SHA256 6fad3b2d3cd0b627fc7d0cd8f4cb8f4f10b9e785ac6b8e3dc635374b6d82bc37
MD5 e34bbe8ce8bbda436d73a22644942ff3
BLAKE2b-256 568dfede3420dd3c0ca7677da1cd66d7d3bb1254ff2764cae4b4d362711610b3

See more details on using hashes here.

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

Hashes for pil_resize_aspect_ratio-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 f981265f9830830e85cf768cf93a9a3bbf5db7c4ea3e6337b43541973983267e
MD5 efd5ab0f67d07140fc1942c43e755b28
BLAKE2b-256 63d7e8147e5406fcc4a1c436a7a330d975f7dba0451c32126e885ac4561d485e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page