Exploring the digital world!
Resizing an Image with Python
I need my own script to resize images. How can I figure this out.
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: https://auth0.com/blog/image-processing-in-python-with-pillow/
image = Image.open('covid-bubble.png') print(image.size) # (626, 543) image.thumbnail((400, 100)) image.save('covid-bubble_thumbnail.png') print(image.size) # (626, 543)