开发者

How to extract a given frame from a .gif animation in Python

开发者 https://www.devze.com 2023-01-11 07:21 出处:网络
I\'m trying to figure out how to extract a given frame from an animated-gif, possibly in PIL, in Python.

I'm trying to figure out how to extract a given frame from an animated-gif, possibly in PIL, in Python. I'm not able to easily dig this up, and I'm guessing it would take some knowledge开发者_StackOverflow社区 of the gif format, something that is not readily understandable to me. Is there any straightforward way to accomplish this? Do I need to do some custom parsing?


Reading Sequences

The GIF loader supports the seek and tell methods. You can seek to the next frame (im.seek(im.tell()+1), or rewind the file by seeking to the first frame. Random access is not supported.

http://effbot.org/imagingbook/format-gif.htm
http://effbot.org/imagingbook/image.htm

0

精彩评论

暂无评论...
验证码 换一张
取 消