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()

Logo

为开发者提供按需使用的算力基础设施。

更多推荐