Many times when downloading an image, you do not want to save the full image, but only a thumbnail. Or you may also save both the full-size image and a thumbnail. Thumbnails can be easily created in python using the Pillow library. Pillow is a fork of the Python Image Library, and contains many useful functions for manipulating images. You can find more information on Pillow at https://python-pillow.org. In this recipe, we use Pillow to create an image thumbnail.
Generating thumbnails for images
Getting ready
The script for this recipe is 04/07_create_image_thumbnail.py. It uses the Pillow library, so make sure you have installed Pillow into your environment with pip or other package management tools:
pip install pillow...