Exploring the digital world!

Resizing an Image with Python

I need my own script to resize images. How can I figure this out.

google python image resize

Somewhere in there I got turned onto Pillow. I want to shrink my image to 100px tall (height). The resize function requires you to enter height and width. The thumbnail option keeps the aspect ratio for you. Here was a great article:

covid bubble

image ='covid-bubble.png')
print(image.size) # (626, 543)
image.thumbnail((400, 100))'covid-bubble_thumbnail.png')
print(image.size) # (626, 543)

covid bubble thumbnail