用pillow模块进行图像翻转

"""用pillow模块进行图像翻转"""

from tkinter import *
from PIL import Image
from PIL import  ImageOps
from PIL import ImageTk

img = Image.open("dog_gif/dog2-a_L.gif")
mirror_img = ImageOps.mirror(img)
mirror_img.save("logo_.png")
print(type(img))

tk = Tk()
canvas = Canvas(tk,width=300,height=300)
canvas.pack()
k = ImageTk.PhotoImage(mirror_img)

canvas.create_image(200,200,image =k)
canvas.update()