robertvari

create thumbnail

Jan 19th, 2020
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. # importing Image class from PIL package  
  2. from PIL import Image
  3.    
  4. # creating a object  
  5. image = Image.open(r"C:\Users\System-Pc\Desktop\python.png")
  6. MAX_SIZE = (100, 100)
  7.  
  8. image.thumbnail(MAX_SIZE)
  9.  
  10. # creating thumbnail
  11. image.save('pythonthumb.png')
  12. image.show()
Advertisement
Add Comment
Please, Sign In to add comment