Skip to content

Instantly share code, notes, and snippets.

@theonewolf
Last active December 20, 2015 22:48
Show Gist options
  • Select an option

  • Save theonewolf/6207642 to your computer and use it in GitHub Desktop.

Select an option

Save theonewolf/6207642 to your computer and use it in GitHub Desktop.
PIL draw test
#!/usr/bin/env python
from PIL import Image, ImageDraw
im = Image.new("RGB", (1024,1024), "white") # you could also Image.open(...)
drawer = ImageDraw.Draw(im)
# draw connecting line
drawer.line((256,256,512,512), fill=96, width=5)
# draw circles; draw second to go over the line
drawer.ellipse((256-10,256-10,256+10,256+10), fill=64, outline=32)
drawer.ellipse((512-10,512-10,512+10,512+10), fill=64, outline=32)
im.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment