from PIL import Image img=Image.open('test.jpg') img=img.resize((300,300)) img.save('small.jpg')