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")
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")
python pillow resize image
from PIL import Image # set the base width of the result basewidth = 300 img = Image.open('somepic.jpg') # determining the height ratio wpercent = (basewidth/float(img.size[0])) hsize = int((float(img.size[1])*float(wpercent))) # resize image and save img = img.resize((basewidth,hsize), Image.ANTIALIAS) img.save('sompic.jpg')
pil resize image
im = Image.open('image.jpg') im = im.resize((w, h))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us