In [1]:
import imageio.v2 as imageio
import numpy as np
import matplotlib.pyplot as plt
def plot_image_from_array(image_array, title=''''Image''''):
plt.imshow(image_array, cmap=''''gray'''')
plt.axis(''''off'''')
plt.title(title)
plt.show()
image = imageio.imread(''''Sharbat_Gula.jpg'''')
print("Image shape:", image.shape)
plot_image_from_array(image,title=''''Original'''')
Image shape: (400, 254, 3)
In [2]:
# Flip the image horizontally
flipped_image_h = np.fliplr(image)
plot_image_from_array(flipped_image_h,title=''''flip h image'''')