Advertisement
Guest User

Untitled

a guest
Dec 9th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. def rotate_or_zoom(pic1):
  2. from PIL import Image
  3. filename = ('alem.jpg')
  4. pic1 = Image.open(filename)
  5.  
  6. #Getting user choice and Error Checking
  7. userchoice = int(input("(1) rotate or \n(2) rotate and zoom: "))
  8. while userchoice == 1 and userchoice == 2:
  9. if userchoice == 1:
  10. pic1_180 = small_pic1.transpose(Image.ROTATE_180)
  11. # If user pics second, rotate and scale it 2x
  12. elif userchoice == 2:
  13. #rotate image 180 degrees
  14. pic1_180 = small_pic1.transpose(Image.ROTATE_180)
  15. width, height = pic1.size
  16. pic1 = pic1.resize((width*2 , height * 2))
  17. return pic1
  18. rotate_or_zoom(pic1).show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement