# -*- mode: python; Encoding: utf-8; coding: utf-8 -*- # Last updated: <2019/11/02 20:58:08 +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", (1024, 1024), (255, 255, 255, 255)) d = ImageDraw.Draw(im) cx, cy = (256 * 2), (256 * 2) for i in range(0, 360, 5): x = int((240 * 2) * math.cos(math.radians(i)) + cx) y = int((240 * 2) * math.sin(math.radians(i)) + cy) d.line((cx, cy, x, y), fill=(0, 0, 0, 255), width=(2 * 2)) im.thumbnail((512, 512), Image.ANTIALIAS) im.save("./output_imagedraw2.png")