188. Image Processing with PIL/Pillow
from PIL import Image
# Open an image
img = Image.open("example.jpg")
# Display the image
img.show()from PIL import Image
# Open an image
img = Image.open("example.jpg")
# Resize the image to 200x200 pixels
resized_img = img.resize((200, 200))
# Save the resized image
resized_img.save("resized_example.jpg")Last updated