from PIL import Image, ImageDraw im = Image.new('RGB', (600, 400), (255, 255, 255)) draw = ImageDraw.Draw(im) draw.rectangle((200, 200, 300, 300), fill=(0, 192, 192), outline=(128, 128, 128)) im.save('kep01.png')