Webp 图像在转换为 gif 时会留下痕迹 - Python Pillow

问题描述 投票:0回答:0

大家好,我正在尝试使用枕头库来制作我在搅拌机中制作的一些图像的 gif。我读到 webp 支持像 gif 这样的透明度和动画,所以我一直在努力让它在我拥有的小片段中工作:

from PIL import Image
import glob

# create frames
frames  = []

images = sorted(glob.glob('00*.webp'))
for i in images:
    newFrame = Image.open(i)
    frames.append(newFrame)

# save frames into gif
frames[0].save('render1.webp', format="GIF", append_images=frames[1:], save_all=True, duration=75, loop=0)

gif 应该看起来像这样,但背景要清晰:

https://imgur.com/a/CEbeXVp

那张图片是用png做的,用webp图片做的是这样的:

https://imgur.com/a/ftsL2qj

任何建议或帮助将不胜感激,谢谢!

python animation python-imaging-library gif webp
© www.soinside.com 2019 - 2024. All rights reserved.