Answers for "change width of an image python"

1

python get image size

from PIL import Image

img = Image.open('path/to/image')
width, height = img.size
im.close()
Posted by: Guest on December-20-2020
0

pyhton image resize

from PIL import Image

from resizeimage import resizeimage

with open('test-image.jpeg', 'r+b')
    with Image.open() as image:
        is_valid = resizeimage.resize_cover.validate(image, [200, 100])

# do something else...

if is_valid:
    with Image.open('test-image.jpeg') as image:
        resizeimage.resize_cover.validate(image, [200, 100], validate=False)
        cover = resizeimage.resize_cover(image, [200, 100])
        cover.save('test-image-cover.jpeg', image.format)
Posted by: Guest on August-05-2020

Code answers related to "change width of an image python"

Python Answers by Framework

Browse Popular Code Answers by Language