from PIL import Image img = Image.open('1.jpg') new_img = img.resize((256,256)) new_img.save('1-256x256.png','png')