Commit 508e5d7e by BellCodeEditor

save project

parent 4a991988
from tkinter import filedialog,Tk
from PIL import Image
from tkinter import filedialog,Tk #导入tk模块里的文件处理小模块
from PIL import Image#导入PIL中的Image功能
root = Tk()
root.withdraw()
path = filedialog.askopenfilenames(title = '选择图片文件',
filetypes = [('ALL Files', '*')],
root = Tk()#使用TK模块赋值root对象
root.withdraw()#消除tk模块里的窗口
path = filedialog.askopenfilenames(title = '选择图片文件',#用文件处理选择多个图片
filetypes = [('png', '.png')],
initialdir = "./")
img_list = []
sequence = []
for i in path:
img = image.open(1)
img_list.insert(0,img)
img = Image.open(i)
sequence.insert(0,img)
img_list[0].save("bot.gif",save_all = True,
append_images = img_list[1:])
\ No newline at end of file
sequence[0].save("dive.gif",save_all = True,
append_images = sequence[1:])
\ No newline at end of file
from PIL import Image,ImageSequence
im=Image.open('dive.gif')
img=Image.open('dive.gif')
num=0
for i in ImageSequence.Iterator(im):
for i in ImageSequence.Iterator(img):
i.save('turn/'+str(num)+'.png')
num+=1
\ No newline at end of file
num+=1 #上课内容,打开动图
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment