Commit 9d85a16c by BellCodeEditor

auto save

parent 9fa5d7e6
This diff is collapsed. Click to expand it.
from tkinter import filedialog,Tk
from PIL import Image
root=Tk()
root.withdraw()#关闭窗口
path=filedialog.askopenfilenames(title="周日",filetypes=[('All Files',"*")],initialdir="./")
print(path)
img_list=[]
for i in path:
img=Image.open(i)
img_list.append(img)
print(img_list)
\ No newline at end of file
from tkinter import filedialog,Tk
from PIL import Image
root=Tk()
root.withdraw()#关闭窗口
path=filedialog.askopenfilenames(title="周日",filetypes=[('All Files',"*")],initialdir="./")
print(path)
img_list=[]
for i in path:
img=Image.open(i)
img_list.append(img)
print(img_list)
#制作动图
img_list[0].save("b.gif",save_all=True,append_images=img_list[1:])
from tkinter import filedialog,Tk
path=filedialog.askopenfilenames(title="周日",filetypes=[('All Files',"*")],initialdir=".")
print(path)
\ No newline at end of file
from tkinter import filedialog,Tk
from PIL import Image
root=Tk()
root.withdraw()
path=filedialog.askopenfilenames(title="选择图片文件",filetypes=[("png",".png")],initialdir="./")
print(path)
\ 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