- Hands-On Image Processing with Python
- Sandipan Dey
- 58字
- 2025-02-22 06:42:30
Creating a thumbnail
We can create a thumbnail from an image with the thumbnail() function, as shown in the following:
im_thumbnail = im.copy() # need to copy the original image first
im_thumbnail.thumbnail((100,100))
# now paste the thumbnail on the image
im.paste(im_thumbnail, (10,10)) im.save("../images/parrot_thumb.jpg") im.show()
The figure shows the output image generated by running the preceding code snippet:
