Frames of transparent gif overlapping with each other

这一生的挚爱 提交于 2021-01-29 14:02:23

问题


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)

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

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


回答1:


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)


来源:https://stackoverflow.com/questions/58997648/frames-of-transparent-gif-overlapping-with-each-other

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!