Skip to content

d0ctr/fill-image-resize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages