Resize images with PIL

How to resize images with PIL. As I used it for the last post, I want to show you how to use the resize function in PIL, Python Imaging Lybrary, in an practical example, that is always the best method to learn and memorize things. There is just one simple line of code (or maybe two).

from PIL import Image

img = Image.open("myimage.png")
img = img.resize((128, 128), Image.ANTIALIAS)
img.save("myimage_little.png")