import Image, ImageDraw, sys
dimensions = (400, 350)
img = Image.new("RGB", dimensions)
draw = ImageDraw.Draw(img)
num =48
i = num
while (i>0) :
draw.line((i*img.size[0]/num, 0, img.size[0], i*img.size[1]/num), (0, 255-i, 0))
draw.line(((num-i)*img.size[0]/num, img.size[1], img.size[0], i*img.size[1]/num), (0, 255-i, 0))
draw.line((0, (num-i)*img.size[1]/num, i*img.size[0]/num, 0), (0, 255-i, 0))
draw.line((0, (i)*img.size[1]/num, i*img.size[0]/num, img.size[1]), (0, 255-i, 0))
i-=1
del draw
# write to stdout
img.save(sys.stdout, "PNG")
aW1wb3J0IEltYWdlLCBJbWFnZURyYXcsIHN5cwoKZGltZW5zaW9ucyA9ICg0MDAsIDM1MCkKaW1nID0gSW1hZ2UubmV3KCJSR0IiLCBkaW1lbnNpb25zKQoKZHJhdyA9IEltYWdlRHJhdy5EcmF3KGltZykKbnVtID00OAoKaSA9IG51bQp3aGlsZSAoaT4wKSA6IAogICBkcmF3LmxpbmUoKGkqaW1nLnNpemVbMF0vbnVtLCAwLCBpbWcuc2l6ZVswXSwgaSppbWcuc2l6ZVsxXS9udW0pLCAoMCwgMjU1LWksIDApKQogICBkcmF3LmxpbmUoKChudW0taSkqaW1nLnNpemVbMF0vbnVtLCBpbWcuc2l6ZVsxXSwgaW1nLnNpemVbMF0sIGkqaW1nLnNpemVbMV0vbnVtKSwgKDAsIDI1NS1pLCAwKSkKICAgCiAgIGRyYXcubGluZSgoMCwgKG51bS1pKSppbWcuc2l6ZVsxXS9udW0sIGkqaW1nLnNpemVbMF0vbnVtLCAwKSwgKDAsIDI1NS1pLCAwKSkgCiAgIGRyYXcubGluZSgoMCwgKGkpKmltZy5zaXplWzFdL251bSwgaSppbWcuc2l6ZVswXS9udW0sIGltZy5zaXplWzFdKSwgKDAsIDI1NS1pLCAwKSkgIAogICBpLT0xCgpkZWwgZHJhdyAKCiMgd3JpdGUgdG8gc3Rkb3V0CmltZy5zYXZlKHN5cy5zdGRvdXQsICJQTkciKQ==