Commit e1fe7c4a by BellCodeEditor

auto save

parent 6f3517e6
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=[("png", ".png")],
initialdir="./")
sequence = []
for i in path:
img = Image.open(i)
sequence.insert(0, img)
sequence[0].save("dive.gif", save_all=True,
append_images=sequence[1:])
\ No newline at end of file
from PIL import Image,ImageSequence
img = Image.open("pi5.gif")
num = 0
for i in ImageSequence.Iterator(img):
i.save("img/"+str(num)+".png") # 这里把分解到的每一张静态图保存到当前目录下
num += 1
\ No newline at end of file
img/0.png

53.8 KB

img/1.png

72.1 KB

img/10.png

67.6 KB

img/11.png

68.7 KB

img/12.png

71.7 KB

img/13.png

71.9 KB

img/14.png

80.7 KB

img/16.png

80.3 KB

img/17.png

75.7 KB

img/19.png

69.7 KB

img/2.png

71.9 KB

img/20.png

72.8 KB

img/21.png

67.1 KB

img/22.png

76.9 KB

img/23.png

68.4 KB

img/24.png

70.3 KB

img/25.png

65.2 KB

img/26.png

67.6 KB

img/27.png

61.1 KB

img/28.png

60.5 KB

img/29.png

52.3 KB

img/3.png

71.8 KB

img/4.png

70.1 KB

img/5.png

67.7 KB

img/6.png

75.5 KB

img/7.png

66.4 KB

img/8.png

66.7 KB

img/9.png

65.8 KB

This diff is collapsed. Click to expand it.
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