Skip to content

Instantly share code, notes, and snippets.

@CLozy
Last active July 12, 2022 12:21
Show Gist options
  • Save CLozy/debaab6bb1c1d9403b56191d3725df73 to your computer and use it in GitHub Desktop.
Save CLozy/debaab6bb1c1d9403b56191d3725df73 to your computer and use it in GitHub Desktop.
rotate image
image = Image.open('/content/gdrive/MyDrive/ComputerVisionEngineer/images/deadstar.jpg')
#plot original image
f = pyplot.figure(figsize=(30,30))
f.add_subplot(131)
pyplot.imshow(image)
#45 degrees rotation
f.add_subplot(132)
pyplot.imshow(image.rotate(45))
#90 degrees rotation
f.add_subplot(133)
pyplot.imshow(image.rotate(90))
pyplot.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment