# -*- mode: python; Encoding: utf-8; coding: utf-8 -*- # Last updated: <2019/11/02 21:02:24 +0900> """ Draw for ImageDraw. Windows10 x64 + Python 3.7.5 32bit + Pillow 6.2.1 + aggdraw 1.3.11 """ from PIL import Image, ImageDraw import math # ImageDraw im = Image.new("RGBA", (512, 512), (255, 255, 255, 255)) d = ImageDraw.Draw(im) cx, cy = 256, 256 for i in range(0, 360, 5): x = int(240 * math.cos(math.radians(i)) + cx) y = int(240 * math.sin(math.radians(i)) + cy) d.line((cx, cy, x, y), fill=(0, 0, 0, 255), width=2) im.save("./output_imagedraw.png")