python 读取git图片每一帧

来源:互联网 发布:mac复制图片 编辑:程序博客网 时间:2024/05/18 00:33
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
0 0
原创粉丝点击