python - 枕头:将 GIF 转换为动画 webp 会产生一些噪音
问题描述
我做了一个简单的转换方法如下:
from PIL import Image
def convert(src, dst):
with Image.open(src) as img:
print(f'file opened = {src}')
if hasattr(img, 'is_animated') and img.is_animated:
print(f'frames = {img.n_frames}')
img.save(dst,
quality=90,
save_all=True)
else:
print('not animated')
img.save(dst, quality=90)
if __name__ == '__main__':
convert('src.gif','dst.webp')
我将一些.gif
图像转换为动画 webp,图像上有噪音。
结果:
我错过了什么?
我正在使用 Python 3.9.7 Pillow 8.3.2。
来源1:
来源2:
解决方案
推荐阅读
- objective-c - 使用参数从 Objective-C 调用 Swift 函数
- cmd - 如何在 Windows 中运行`ng`
- java - Java关于对象数组
- c - strcpy 在我的代码中出现分段错误
- android - Admob 错误:无法加载广告
- python - 根据输入词 NLP 提取相关句子
- pdf - 在 JavaFX 应用程序中显示 pdf
- sql - 将 ActiveRecord 对象转换为数组
- geoserver - 如何从 Openlayer 请求优化 GeoWebcache 的响应速度或性能
- java - EntityManagerFactory 使用 Springboot 和 Elide 为空