11 result+="\\%03o"%ord(c)
21 fmt="".join(img.getbands())
27 result="storage %s %d %d;\n"%(fmt, img.size[0], img.size[1])
28 result+="min_filter LINEAR;\n"
30 data=list(img.getdata())
31 for y in range(img.size[1]):
32 i=(img.size[1]-1-y)*img.size[0]
33 result+=escape("".join(["".join([chr(v) for v in p]) for p in data[i:i+img.size[0]]]))
38 if __name__=="__main__":
43 print "Usage: %s <image>"%sys.argv[0]
45 out=file(os.path.splitext(sys.argv[1])[0]+".tex", "w")
46 out.write(make_tex(sys.argv[1]))