Answers for "change size of image python"

2

python resize image

from PIL import Image
image = Image.open("path/.../image.png")
image = image.resize((500,500),Image.ANTIALIAS)
image.save(fp="newimage.png")
Posted by: Guest on June-15-2020
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
0

pyhton image resize

from PIL import Image
from resizeimage import resizeimage

fd_img = open('test-image.jpeg', 'r')
img = Image.open(fd_img)
img = resizeimage.resize_cover(img, [200, 100])
img.save('test-image-cover.jpeg', img.format)
fd_img.close()
Posted by: Guest on August-05-2020
0

how to reduce the image files size in python

from PIL import Image
im = Image.open('test.tiff')
im.save('test.jpeg')
Posted by: Guest on September-05-2021

Python Answers by Framework

Browse Popular Code Answers by Language