Azi*_*tov 5 python gif python-imaging-library webp
我已经尝试过这个:
from PIL import Image
im = Image.open('this.webp')
im.save('that.gif', 'gif', save_all=True)
Run Code Online (Sandbox Code Playgroud)
这给了我这个错误
类型错误:& 不支持的操作数类型:“tuple”和“int”
我的网站上有数百张 webp 图像,需要将它们转换为 gif,因为 Firefox 不支持它。谢谢。
保存前将背景设置为“无”。
from PIL import Image
im = Image.open('this.webp')
im.info.pop('background', None)
im.save('that.gif', 'gif', save_all=True)
Run Code Online (Sandbox Code Playgroud)
感谢:https://github.com/python-pillow/Pillow/issues/2949#issuecomment-419422861