Commit e7d2e80e by BellCodeEditor

save project

parent 125f7763
Showing with 13 additions and 4 deletions
...@@ -4,13 +4,13 @@ from PIL import Image #导入PIL中的Image功能 ...@@ -4,13 +4,13 @@ from PIL import Image #导入PIL中的Image功能
root = Tk() #使用TK模块赋值给root对象 root = Tk() #使用TK模块赋值给root对象
root.withdraw() #消除tk模块自带的小窗口 root.withdraw() #消除tk模块自带的小窗口
path = filedialog.askopenfilenames(title = '选择图片文件', #使用文件处理模块 path = filedialog.askopenfilenames(title = '选择图片文件', #使用文件处理模块
filetypes = [('png', '.png')], #选的多个图片 filetypes = [('peg', '.peg')], #选的多个图片
initialdir = "./") initialdir = "./")
img_list = [] img_list = []
for i in path: for i in path:
img = Image.open(i) img = image.open(1)
img_list.insert(0, img) img_list.insert(img)
img_list[0].save("dive.gif",save_all = True, img_list[0].save("bot.gif",save_all = True,
append_images = img_list[1:]) append_images = img_list[1:])
\ No newline at end of file
from PIL import Image,ImageSequence
img = Image.open('dive.gif')
num= 0
for i in ImageSequence.Iterator(img):
i.save(r'./img'+str(num)+'.png')
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