您的位置:首页 > 编程语言 > Python开发

python 读取git图片每一帧

2015-09-16 17:49 537 查看
def processImage(infile):
try:
im = Image.open(infile)
except IOError:
print "Cant load", infile
sys.exit(1)
i = 0
mypalette = im.getpalette()

try:
while 1:
#im.putpalette(mypalette)
new_im = Image.new("RGBA", im.size)
new_im.paste(im)
new_im.save('0000_'+str(i)+'.png')

i += 1
im.seek(im.tell() + 1)
except EOFError:
pass # end of sequence
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: