fork download
  1. import Image, ImageDraw, sys
  2.  
  3. dimensions = (500, 200)
  4. img = Image.new("RGB", dimensions)
  5.  
  6. draw = ImageDraw.Draw(img)
  7. num =10
  8.  
  9. i = num
  10. while (i>0) :
  11. draw.line((0, 0, img.size[0], i*img.size[1]/num), (0, 255, 0))
  12. draw.line((0, img.size[1], img.size[0], i*img.size[1]/num), (0, 255, 0))
  13. i-=1
  14.  
  15. del draw
  16.  
  17. # write to stdout
  18. img.save(sys.stdout, "PNG")
Success #stdin #stdout 0.16s 12392KB
stdin
Try to modify the picture by yourself.

Some suggestions:
1. Modify the number of iterations
2. Add more lines  
3. Use arcs instead of lines
4. Use more colors
 
stdout