Python problem with resize animate GIF

Posted by gigimon on Stack Overflow See other posts from Stack Overflow or by gigimon
Published on 2010-05-24T09:46:27Z Indexed on 2010/05/24 9:51 UTC
Read the original article Hit count: 261

Filed under:
|
|
|

Hello!

I'm want to resize animated GIF with save animate. I'm try use PIL and PythonMagickWand (ImageMagick) and with some GIF's get bad frame. When I'm use PIL, it mar frame in read frame. For test, I'm use this code:


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()

When I'm use MagickWand with this code:


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)

My GIF where I'm get bad frame this: test gif

In GIF editor software, all freme is ok. Where problem? Thx

© Stack Overflow or respective owner

Related posts about python

Related posts about animation