from PIL import Image, ImageDraw
import math

def draw_gear(draw):
    draw.ellipse([3, 3, 13, 13], outline="gray", width=2)
    draw.ellipse([6, 6, 10, 10], fill="white")
    for angle in range(0, 360, 45):
        rad = math.radians(angle)
        x1 = 8 + 4 * math.cos(rad)
        y1 = 8 + 4 * math.sin(rad)
        x2 = 8 + 6 * math.cos(rad)
        y2 = 8 + 6 * math.sin(rad)
        draw.line([x1, y1, x2, y2], fill="gray", width=2)

img = Image.new('RGBA', (16, 16), (255, 255, 255, 0))
draw = ImageDraw.Draw(img)
draw_gear(draw)
img.save('test_gear.png')
print("Done")
