相互重叠的透明 gif 帧 [英] Frames of transparent gif overlapping with each other

查看:46
本文介绍了相互重叠的透明 gif 帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过这段代码在python中通过枕头创建一个透明的gif

I'm trying to create a transparent gif through pillow in python through this code

frames[0].save(path+'/final.gif', format='GIF', append_images=frames[1:], save_all=True, duration=33, loop=0,transparency=0)

其中 frame 是 PIL.Image 文件的列表.最终结果是可以看到上一帧的图像

where frame is a list of PIL.Image files. The end result is that you can see the image in the previous frame

这以前从未发生过,我能够毫无问题地创建此 gif

This hasn't happened before and I was able to create this gif without any problems

推荐答案

我通过设置 disposal = 2 解决了这个问题,你可以编辑你的代码为:

I solved this problem by setting disposal = 2 , you can edit your code as:

frames[0].save(path+'/final.gif', format='GIF', append_images=frames[1:], save_all=True, duration=33, loop=0,transparency=0, disposal = 2)

这篇关于相互重叠的透明 gif 帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆