diff --git a/b.py b/b.py index f6dc96f..2869c77 100644 --- a/b.py +++ b/b.py @@ -1,12 +1,12 @@ -from tkinter import filedialog, Tk +from tkinter import filedialog, Tk from PIL import Image -rt=Tk() -rt.withdraw() -path=filedialog.askopenfilenames(title='选择图片文件',filetypes=[('png','.png')],initialdir='./') -sequence=[] -for i in path: - img=Image.open(i) +rt=Tk() #使用TK模块赋值给root对象 +rt.withdraw() #使用TK模块赋值给root对象 +path=filedialog.askopenfilenames(title='选择图片文件',filetypes=[('png','.png')],initialdir='./') #使用TK模块赋值给root对象 +sequence=[] #创建空列表 #选择多个图片 +for i in path: #遍历 + img=Image.open(i) #打开图片 sequence.append(img) sequence[0].save("bot.gif",save_all=True, - append_images=sequence[1:]) \ No newline at end of file + append_images=sequence[1:]) \ No newline at end of file diff --git a/bot.gif b/bot.gif index a3e8833..ccf34ce 100644 Binary files a/bot.gif and b/bot.gif differ diff --git a/d.py b/d.py index 74656b2..6a71abe 100644 --- a/d.py +++ b/d.py @@ -1,16 +1,16 @@ from tkinter import filedialog,Tk from PIL import Image -root = Tk() -root.withdraw() -path = filedialog.askopenfilenames(title = '选择图片文件', - filetypes = [('ALL Files', '*')], +root = Tk()#使用TK模块赋值给root对象 +root.withdraw()#使用TK模块赋值给root对象 +path = filedialog.askopenfilenames(title = '选择图片文件', #使用TK模块赋值给root对象 + filetypes = [('png', 'png')], #选择多个图片 initialdir = "./") -img_list = [] -for i in path: - img = image.open(1) - img_list.insert(0,img) +img_list = []#创建空列表 +for i in path:#遍历 + img = Image.open(i) + img_list.insert(0,img)#打开图片 -img_list[0].save("bot.gif",save_all = True, - append_images = img_list[1:]) \ No newline at end of file +img_list[0].save("dive.gif",save_all = True, + append_images = img_list[1:]) \ No newline at end of file diff --git a/dd.py/ddd.py b/dd.py/ddd.py deleted file mode 100644 index 0c38192..0000000 --- a/dd.py/ddd.py +++ /dev/null @@ -1,7 +0,0 @@ -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 diff --git a/dive.gif b/dive.gif index 99f1b29..7c0c30b 100644 Binary files a/dive.gif and b/dive.gif differ diff --git a/img/0.png b/img/0.png new file mode 100644 index 0000000..e247eeb Binary files /dev/null and b/img/0.png differ diff --git a/img/1.png b/img/1.png new file mode 100644 index 0000000..6dd9f1a Binary files /dev/null and b/img/1.png differ diff --git a/img/10.png b/img/10.png new file mode 100644 index 0000000..3bb9d13 Binary files /dev/null and b/img/10.png differ diff --git a/img/11.png b/img/11.png new file mode 100644 index 0000000..76fd329 Binary files /dev/null and b/img/11.png differ diff --git a/img/12.png b/img/12.png new file mode 100644 index 0000000..b652ab3 Binary files /dev/null and b/img/12.png differ diff --git a/img/13.png b/img/13.png new file mode 100644 index 0000000..c914e7a Binary files /dev/null and b/img/13.png differ diff --git a/img/14.png b/img/14.png new file mode 100644 index 0000000..378694b Binary files /dev/null and b/img/14.png differ diff --git a/img/15.png b/img/15.png new file mode 100644 index 0000000..8e8bd87 Binary files /dev/null and b/img/15.png differ diff --git a/img/16.png b/img/16.png new file mode 100644 index 0000000..bacd778 Binary files /dev/null and b/img/16.png differ diff --git a/img/17.png b/img/17.png new file mode 100644 index 0000000..8300da8 Binary files /dev/null and b/img/17.png differ diff --git a/img/18.png b/img/18.png new file mode 100644 index 0000000..95be816 Binary files /dev/null and b/img/18.png differ diff --git a/img/19.png b/img/19.png new file mode 100644 index 0000000..34b205e Binary files /dev/null and b/img/19.png differ diff --git a/img/2.png b/img/2.png new file mode 100644 index 0000000..35613f8 Binary files /dev/null and b/img/2.png differ diff --git a/img/20.png b/img/20.png new file mode 100644 index 0000000..60ea0ac Binary files /dev/null and b/img/20.png differ diff --git a/img/21.png b/img/21.png new file mode 100644 index 0000000..d7b9146 Binary files /dev/null and b/img/21.png differ diff --git a/img/22.png b/img/22.png new file mode 100644 index 0000000..1bfd5b4 Binary files /dev/null and b/img/22.png differ diff --git a/img/23.png b/img/23.png new file mode 100644 index 0000000..3c0996d Binary files /dev/null and b/img/23.png differ diff --git a/img/24.png b/img/24.png new file mode 100644 index 0000000..0263592 Binary files /dev/null and b/img/24.png differ diff --git a/img/25.png b/img/25.png new file mode 100644 index 0000000..076c250 Binary files /dev/null and b/img/25.png differ diff --git a/img/26.png b/img/26.png new file mode 100644 index 0000000..5eb04b2 Binary files /dev/null and b/img/26.png differ diff --git a/img/27.png b/img/27.png new file mode 100644 index 0000000..e419137 Binary files /dev/null and b/img/27.png differ diff --git a/img/28.png b/img/28.png new file mode 100644 index 0000000..f298c59 Binary files /dev/null and b/img/28.png differ diff --git a/img/29.png b/img/29.png new file mode 100644 index 0000000..42750bd Binary files /dev/null and b/img/29.png differ diff --git a/img/3.png b/img/3.png new file mode 100644 index 0000000..0476373 Binary files /dev/null and b/img/3.png differ diff --git a/img/30.png b/img/30.png new file mode 100644 index 0000000..ef1ed3a Binary files /dev/null and b/img/30.png differ diff --git a/img/31.png b/img/31.png new file mode 100644 index 0000000..8b62acb Binary files /dev/null and b/img/31.png differ diff --git a/img/32.png b/img/32.png new file mode 100644 index 0000000..85f2d40 Binary files /dev/null and b/img/32.png differ diff --git a/img/33.png b/img/33.png new file mode 100644 index 0000000..00f6069 Binary files /dev/null and b/img/33.png differ diff --git a/img/34.png b/img/34.png new file mode 100644 index 0000000..2eac8f3 Binary files /dev/null and b/img/34.png differ diff --git a/img/35.png b/img/35.png new file mode 100644 index 0000000..9733eb4 Binary files /dev/null and b/img/35.png differ diff --git a/img/36.png b/img/36.png new file mode 100644 index 0000000..7a3be78 Binary files /dev/null and b/img/36.png differ diff --git a/img/4.png b/img/4.png new file mode 100644 index 0000000..597f4a4 Binary files /dev/null and b/img/4.png differ diff --git a/img/5.png b/img/5.png new file mode 100644 index 0000000..950a184 Binary files /dev/null and b/img/5.png differ diff --git a/img/6.png b/img/6.png new file mode 100644 index 0000000..7a50fc6 Binary files /dev/null and b/img/6.png differ diff --git a/img/7.png b/img/7.png new file mode 100644 index 0000000..a9a4122 Binary files /dev/null and b/img/7.png differ diff --git a/img/8.png b/img/8.png new file mode 100644 index 0000000..15a2036 Binary files /dev/null and b/img/8.png differ diff --git a/img/9.png b/img/9.png new file mode 100644 index 0000000..fafe92f Binary files /dev/null and b/img/9.png differ diff --git a/img/py.py b/img/py.py index 4068d56..a11ff24 100644 --- a/img/py.py +++ b/img/py.py @@ -1,7 +1,7 @@ -from PIL import Image,ImageSequence +from PIL import Image,ImageSequence #导入模块 -img = Image.open("dive.gif") +img = Image.open("dive.gif") #打开跳水的动图 num = 0 for i in ImageSequence.Iterator(img): - i.save(r"./img"+str(num)+".png") + i.save("img/"+str(num)+".png") num += 1 \ No newline at end of file