Last active
August 29, 2015 14:26
-
-
Save kung-foo/5022ec1ed6237bf33b66 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
import Image, ImageDraw | |
from random import randint | |
def draw_picture(output_filename): | |
print('drawing: {}'.format(output_filename)) | |
image = Image.new('RGB', (640, 480), 'black') | |
draw = ImageDraw.Draw(image) | |
for i in xrange(0, 640, 20): | |
for j in xrange(0, 480, 20): | |
draw.ellipse( | |
(i + 1, j + 1, i + 19, j + 19), | |
fill='hsl({}, 100%, 50%)'.format(randint(0, 256)), | |
outline='white') | |
image.save(output_filename) | |
for img_id in xrange(30): | |
draw_picture('circles-{}.png'.format(img_id)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment