Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
114 views
ubuntu2004
Kernel: Python 3 (system-wide)
import numpy as np import matplotlib.pyplot as plt
picture = plt.imread('DSCF0867.JPG')
plt.imshow(picture)
<matplotlib.image.AxesImage at 0x7fb637860c40>
Image in a Jupyter notebook
picture_2 = np.array(picture) picture_2[:,:,:] = picture_2[::-1,::-1,::] plt.imshow(picture_2)
<matplotlib.image.AxesImage at 0x7fb631542670>
Image in a Jupyter notebook

The code above is the 180 degree rotation of the first image. You take the original image and you take the second to last value with -1. This then rotates your image and you get picture_2.