Quantcast
Channel: WP快站
Viewing all articles
Browse latest Browse all 233

Edit animated gif header loop value using Python

$
0
0

I'd like to change the loop header value of a gif animation, specifically this one:

enter image description hereattribution: Gonfer at en.wikipedia

I am attempting to use the python imaging library, PIL, and have come up with the following based on another question.

import PIL as pa=p.Image.open('Unfasor.gif')loop = a.info['loop']a.save('out.gif',loop=10)

This re-saves the gif but it is no longer animated.

Note the value of the loop attribute is presently 0:

>>> a.info{'duration': 0, 'version': 'GIF89a', 'loop': 0, 'extension': ('NETSCAPE2.0', 27L)}

How can I export as a working animated gif, with a non-zero loop value? I am open to using other libraries.

Note. The reason that I am doing this is that I'd like to put the image into a powerpoint-2007 presentation and have seen suggestions that this loop value is a limiting factor.


Viewing all articles
Browse latest Browse all 233

Trending Articles