pil save image

im = Image.open('image.jpg')  
im = im.resize((w, h)) 

Here is what the above code is Doing:
1. We’re using the Image module from the PIL library to open the image.
2. We’re using the resize() method to resize the image.
3. We’re passing the width and height as arguments to the resize() method.
4. We’re storing the resized image in the im variable.