flag.py 367 Bytes
# This program draws Poland's flag and outputs it to a file called out.png

from PIL import Image, ImageDraw

WIDTH = 1000
HEIGHT = 15 * 50
flag = Image.new("RGB", (WIDTH, HEIGHT), (255, 255, 255))

draw = ImageDraw.Draw(flag)

# (top-left x, top-left y, bottom-right x, bottom-right y)
draw.rectangle((0, HEIGHT/2, WIDTH, HEIGHT), (255, 0, 0))

flag.save('out.png')