Commit e204b694 by BellCodeEditor

auto save

parent 98c77c2a
Showing with 40 additions and 0 deletions
import imageio
def create_gif(image_list, gif_name, duration = 1.0):
'''
:param image_list: 这个列表用于存放生物动图的图片
:param gif_name: 字符串,所生成gif文件名,带。gif后缓
:param duration: 图像间隔时间
:return:
'''
frames = []
for image_name in image_list:
frames.append(imageio.imread(image_name))
imageio.mimsave(gif_name,frames,'GIF',duration=duration)
return
def main():
image_list=['1,jpg','2.jpg''3jpg]
gif_name = 'new.gif'
duration = 1.5
create_gif(image_list,gif_name,duration)
if __name__ == '__main__':
main()
\ No newline at end of file
from tkinter import filedialog,Tk
from PIL import Image
root = Tk()
root.withdraw()
path = filedialog.askopenfilenames(title = '选择图片文件',
filetypes = [('peg', '.peg')],
initialdir = "./")
img_list = []
for i in path:
img = image.open(1)
img_list.insert(img)
img_list[0].save("bot.gif",save_all = True,
append_images = img_list[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