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

Python: Converting GIF frames to PNG

$
0
0

I'm very new to python, trying to use it to split the frames of a GIF into PNG images.

# Using this GIF: http://www.videogamesprites.net/FinalFantasy1/Party/Before/Fighter-Front.giffrom PIL import Imageim = Image.open('Fighter-Front.gif')transparency = im.info['transparency'] im.save('test1.png', transparency=transparency)im.seek(im.tell()+1)transparency = im.info['transparency'] im.save('test2.png', transparency=transparency)# First frame comes out perfect, second frame (test2.png) comes out black,# but in the "right shape", i.e. # https://i.stack.imgur.com/5GvzC.png

Is this specific to the image I'm working with or am I doing something wrong?

Thanks!


Viewing all articles
Browse latest Browse all 233

Trending Articles