from PIL import Image
image = Image.open("test.jpg")
image.save("test2.jpg", quality=0, optimize=True)
>>> from PIL import Image
# My image is a 200x374 jpeg that is 102kb large
>>> foo = Image.open("path oimage.jpg")
>>> foo.size
(200,374)
# I downsize the image with an ANTIALIAS filter (gives the highest quality)
>>> foo = foo.resize((160,300),Image.ANTIALIAS)
>>> foo.save("path osaveimage_scaled.jpg",quality=95)
# The saved downsized image size is 24.8kb
>>> foo.save("path osaveimage_scaled_opt.jpg",optimize=True,quality=95)
# The saved downsized image size is 22.9kb