请问如何在此基础上写代码实现图片的水平翻转

img


代码
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)

from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
img=np.array(Image.open("F:\\PythonDemo\\face.jpg").convert("L"))
# plt.imshow(img,plt.cm.gray)

print(img)
row=(img.shape[0])
print(row)
img1=img[::-1]
print(img1)

img3 = Image.fromarray(np.fliplr(img))
plt.imshow(img3,plt.cm.gray)

img

Image.fromarray(np.fliplr(np,array(PIL_obj)))