Last active
September 2, 2016 17:40
-
-
Save luelista/149c1d2f7d65f3cf7a0ab6747ad8c966 to your computer and use it in GitHub Desktop.
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
def drawbars(img, width, height): | |
x=0 | |
while x<width: | |
img.paste((255,0,0), (x,0,x+1,height)) | |
x+=2 | |
img.paste((255,0,0), (x,0,x+3,height)) | |
x+=6 | |
img.paste((0,255,0), (x,0,x+1,height)) | |
x+=2 | |
img.paste((0,255,0), (x,0,x+2,height)) | |
x+=6 | |
img.paste((0,0,255), (x,0,x+1,height)) | |
x+=2 | |
img.paste((0,0,255), (x,0,x+1,height)) | |
x+=6 | |
img=PIL.Image.new('RGB',(320,240)) | |
drawbars(img, 320, 240) | |
img.save("/home/mw/Web/test1.png") | |
img=PIL.Image.new('RGB',(320,240)) | |
img.paste((255,255,255), (0,120,320,240)) | |
drawbars(img, 320, 240) | |
img.save("/home/mw/Web/test2.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment