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