Python resize image without PIL code example
Example 1: 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")
Example 2: pil image resize not working
from PIL import Image
#...
img = img.resize((150, newheight), Image.ANTIALIAS)