from PIL import Image
image = Image.open('2.jpg')
image.thumbnail((256, 256), Image.ANTIALIAS)
image.save('11.jpg', quality=100)
Python Image Library produces a crappy quality jpeg when I resize a picture