Last active
December 20, 2015 22:48
-
-
Save theonewolf/6207642 to your computer and use it in GitHub Desktop.
PIL draw test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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