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:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.163.250