【发布时间】:2011-02-23 04:09:26
【问题描述】:
我想通过保存动画来调整动画 GIF 的大小。我正在尝试使用 PIL 和 PythonMagickWand (ImageMagick) 并使用一些 GIF 获取坏帧。当我使用 PIL 时,它会在读取帧中破坏帧。为了测试,我使用这个代码:
from PIL import Image
im = Image.open('d:/box_opens_closes.gif')
im.seek(im.tell()+1)
im.seek(im.tell()+1)
im.seek(im.tell()+1)
im.show()
当我在这段代码中使用 MagickWand 时:
wand = NewMagickWand()
MagickReadImage(wand, 'd:/Box_opens_closes.gif')
MagickSetLastIterator(wand)
length = MagickGetIteratorIndex(wand)
MagickSetFirstIterator(wand)
for i in range(0, length+1):
MagickSetIteratorIndex(wand,i)
MagickScaleImage(wand, 87, 58)
MagickWriteImages(wand, 'path', 1)
我遇到问题的 GIF 框架如下:test gif
在 GIF 编辑软件中,所有帧都可以。问题出在哪里?谢谢。
【问题讨论】:
-
坏帧是什么样子的?
-
错误结果示例:i46.tinypic.com/4qgdx5.gif
标签: python animation python-imaging-library gif