17 result+="\\%03o"%ord(c)
22 img=Image.open(sys.argv[1])
23 out=file(os.path.splitext(sys.argv[1])[0]+".tex", "w")
24 fmt="".join(img.getbands())
29 out.write("storage %s %d %d 0;\n"%(fmt, img.size[0], img.size[1]))
30 out.write("min_filter LINEAR;\n")
31 out.write("raw_data \"")
32 data=list(img.getdata())
33 for y in range(img.size[1]):
34 i=(img.size[1]-1-y)*img.size[0]
35 out.write(escape("".join(["".join([chr(v) for v in p]) for p in data[i:i+img.size[0]]])))