My_GIF.py
448 Bytes
from tkinter import filedialog,Tk
from PIL import Image
rt=Tk()
rt.withdraw()
ph=filedialog.askopenfilenames(title='选择图片文件',filetypes=[('png','.png')],initialdir='./')
il=[]
for i in ph:
im=Image.open(i)
il.append(im)
il[0].save("Robot.gif", save_all=True,append_images=il[1:])
#s = Tk()
#s.withdraw()
ph = filedialog.askopenfilenames(title='选择图片文件',filetypes[('png','.png')],initialdir='./')