代码
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
img=np.array(Image.open("C:\Users\lenovo\Pictures\a\女孩.jpg").convert("L"))
plt.imshow(img,plt.cm.gray)
print(img)
row=(img.shape[0])
print(row)
img1=img[::-1]
print(img1)
plt.imshow(img,plt.cm.gray)