Answers for "PIL image size"

10

python pil resize image

from PIL import Image

# Image.open() can also open other image types
img = Image.open("some_random_image.jpg")
# WIDTH and HEIGHT are integers
resized_img = img.resize((WIDTH, HEIGHT))
resized_img.save("resized_image.jpg")
Posted by: Guest on April-05-2020
8

pil get image size

from PIL import Image

im = Image.open('whatever.png')
width, height = im.size
Posted by: Guest on April-01-2020
2

width and height of pil image

image = PIL.Image.open("sample.png")
width, height = image.size
Posted by: Guest on January-15-2021
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
2

pil resize image

im = Image.open('image.jpg')  
im = im.resize((w, h))
Posted by: Guest on October-17-2020
0

save imag epillow

im.save(file + ".thumbnail", "JPEG")
Posted by: Guest on January-04-2021

Python Answers by Framework

Browse Popular Code Answers by Language