How to save an image in Pillow Python

In this article, you’ll see how to save an image in Pillow Python. To read and save an image you just need to change the name and location of the image.

# Import the PIL library
from PIL import Image

# Read the image from location
img ="C:\\AiHints\\cats.jpg")

# Resize the image
resized_img = image.resize((500, 250))

# Save the resized image"C:\\AiHints\\Resized_Image.jpg")



Recommendation: Computer Vision: Models, Learning, and Inference Book

Leave a Comment

Your email address will not be published.