1. Create a reflection of the given image.
2. Submit the code
images name(mt-rainier.jpg)
from PIL import Image
from numpy import asarray
def reverse_img(filename, reversed_filename):
image = Image.open(image_name)
data = asarray(image)
for i in range(len(data)):
data[i] = data[i][::-1]
image2 = Image.fromarray(data)
image2.save(reversed_filename)
image_name = 'mt-rainier.jpg'
reflected_name = 'mt-rainier_ref.jpg'
reverse_img(image_name, reflected_name)
Comments
Leave a comment