问题
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