Skip to content

Instantly share code, notes, and snippets.

@thorikawa
Created April 12, 2018 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thorikawa/25c949e6e0e5a197a62f4c157df85a43 to your computer and use it in GitHub Desktop.
Save thorikawa/25c949e6e0e5a197a62f4c157df85a43 to your computer and use it in GitHub Desktop.
from PIL import Image, ImageDraw
im = Image.new('RGB', (500, 300), (128, 128, 128))
draw = ImageDraw.Draw(im)
im.save('test.jpg', quality=95)
R_STEP = 4
r = 4
RADIAN_STEP = math.pi * 137.5 / 180.0
radian = 0.0
for i in range(40):
x = r * math.cos(radian)
y = r * math.sin(radian)
draw.ellipse((x, y, x+4, y+4), fill=(255, 0, 0), outline=(0, 0, 0))
r = r + R_STEP
radian + RADIAN_STEP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment