Skip to main content

Package provides function for rather neat image resizing (like Fill resize in Figma)

Project description

Package overview

This package is dedicated to solve problem of resizing images from one size and aspect ration to another in fancier way. This was inspired by Figma, where you can resize image using "Fill" type, so that image is not stretched.

What happenes

fill_image_resize

How to use

Getting an image from local storage and using it afterwards

from fill_image_resize import resize


path = 'image.png'
desired_width = 1020
desired_height = 1000
resized_image = resize(path, desired_width, desired_height)
resized_image.save('resized_image.png')

Getting an image from the net and automaticly saving it

from fill_image_resize import resize


path = 'https://user-images.githubusercontent.com/33842017/133638932-0c9f9053-4e32-4675-8c44-988b1efd8fab.png'
desired_width = 1020
desired_height = 1000
resize(path, desired_width, desired_height, 'resized_image.png')

Requirements

Pillow >= 7.0.0

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

fill-image-resize-1.2.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

fill_image_resize-1.2.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file fill-image-resize-1.2.0.tar.gz.

File metadata

  • Download URL: fill-image-resize-1.2.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for fill-image-resize-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f66904a0ee4f50d418b4475fc4c44bf4ee1099208f8c32b31d72122c74ffeaa6
MD5 944dd9ee6269f4a8aa11f03b58790190
BLAKE2b-256 b335ed4c67d6dccc6d10746acab478b8d853b8fc7ab260fa4fb095a799f113b3

See more details on using hashes here.

File details

Details for the file fill_image_resize-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: fill_image_resize-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for fill_image_resize-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98a6d5e162bad3ef3d0d6c218704befe3af0d166bce36681eeb0f33dea8549a9
MD5 fd835b7e7f77d62ba6d605b7497de98b
BLAKE2b-256 80d36a824f2605d38b0196fd0ddb95a3fa3418d8d7352900ee0d1a65d6c3502c

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