def Rollover_Image(img_file):
img = cv2.imread(img_file,cv2.IMREAD_UNCHANGED)
img180=np.flipud(img)
return img180
from PIL import Image
def flip_image(img_path,output_flip_left_right,output_flip_top_bottom):
img = Image.open(img_path)
img = img.convert("RGB")
flip_left_right = img.transpose(Image.FLIP_LEFT_RIGHT)
flip_top_bottom = img.transpose(Image.FLIP_TOP_BOTTOM)
flip_left_right.save(output_flip_left_right)
flip_top_bottom.save(output_flip_top_bottom)
if __name__ == '__main__':
img_path= 'D:/daily/04/0411/1.jpg'
output_flip_left_right = 'D:/daily/04/0411/flip_left_right.jpg'
output_flip_top_bottom = 'D:/daily/04/0411/flip_top_bottom.jpg'
flip_image(img_path,output_flip_left_right,output_flip_top_bottom)