python制作GIF动图
无
·
import imageio
def create_gif(image_list,gif_name,duration=0.5):
frames=[]
for image_name in image_list:
frames.append(imageio.v2.imread(image_name))
imageio.mimsave(gif_name,frames,'GIF',duration=duration)
return
def main():
#下一行列表里的是、每张图片
image_list=["E:\\scan\\123\\20221117094453697 - 副本 (4).png","E:\\scan\\123\\20221117094453697 - 副本.png","E:\\scan\\123\\CGSQ2022111600002.png","E:\\scan\\123\\None.png"]
gif_name='new.gif'
duration=0.1
create_gif(image_list,gif_name,duration)
if __name__ == '__main__':
main()
更多推荐
已为社区贡献1条内容
所有评论(0)