【发布时间】:2017-11-30 10:26:46
【问题描述】:
我想从 Linux 的 python 控制台打开一个 GIF 图像。通常在打开.png 或.jpg 时,我会执行以下操作:
>>> from PIL import Image
>>> img = Image.open('test.png')
>>> img.show()
但如果我这样做:
>>> from PIL import Image
>>> img = Image.open('animation.gif')
>>> img.show()
Imagemagick 将打开,但只显示 gif 的第一帧,而不是动画。
有没有办法在 Linux 的查看器中显示 GIF 的动画?
【问题讨论】:
-
你的操作系统是什么?
img.show()在 Win32 和 Mac 上将临时图像转换为BMP格式。
标签: python linux python-imaging-library gif animated-gif