def pil_render_lines(lines,height=300,width=300,fname="bs.png"):
import Image,ImageDraw
img = Image.new("RGB",(width,height),(255,255,255))
draw = ImageDraw.Draw(img)
for line in lines: draw.line(line,(0,0,0))
img.save(fname,"PNG")
#os.system("display %s" % fname) # use ImageMagick to display
return
评论列表
文章目录