import Image, ImageDraw, sys
dimensions = (400, 350)
img = Image.new("RGB", dimensions)
draw = ImageDraw.Draw(img)
num =64
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")
aW1wb3J0IEltYWdlLCBJbWFnZURyYXcsIHN5cwoKZGltZW5zaW9ucyA9ICg0MDAsIDM1MCkKaW1nID0gSW1hZ2UubmV3KCJSR0IiLCBkaW1lbnNpb25zKQoKZHJhdyA9IEltYWdlRHJhdy5EcmF3KGltZykKbnVtID02NAoKaSA9IG51bQp3aGlsZSAoaT4wKSA6IAogICBkcmF3LmxpbmUoKGkqaW1nLnNpemVbMF0vbnVtLCAwLCBpbWcuc2l6ZVswXSwgaSppbWcuc2l6ZVsxXS9udW0pLCAoMCwgMjU1LWksIDApKQogICBkcmF3LmxpbmUoKChudW0taSkqaW1nLnNpemVbMF0vbnVtLCBpbWcuc2l6ZVsxXSwgaW1nLnNpemVbMF0sIGkqaW1nLnNpemVbMV0vbnVtKSwgKDAsIDI1NS1pLCAwKSkKICAgCiAgIGRyYXcubGluZSgoMCwgKG51bS1pKSppbWcuc2l6ZVsxXS9udW0sIGkqaW1nLnNpemVbMF0vbnVtLCAwKSwgKDAsIDI1NS1pLCAwKSkgCiAgIGRyYXcubGluZSgoMCwgKGkpKmltZy5zaXplWzFdL251bSwgaSppbWcuc2l6ZVswXS9udW0sIGltZy5zaXplWzFdKSwgKDAsIDI1NS1pLCAwKSkgIAogICBpLT0xCgpkZWwgZHJhdyAKCiMgd3JpdGUgdG8gc3Rkb3V0CmltZy5zYXZlKHN5cy5zdGRvdXQsICJQTkciKQ==
aW1wb3J0IEltYWdlLCBJbWFnZURyYXcsIHN5cwogCmRpbWVuc2lvbnMgPSAoNDAwLCAzNTApCmltZyA9IEltYWdlLm5ldygmcXVvdDtSR0ImcXVvdDssIGRpbWVuc2lvbnMpCiAKZHJhdyA9IEltYWdlRHJhdy5EcmF3KGltZykKbnVtID0xNDgKIAppID0gbnVtCndoaWxlIChpJmd0OzApIDogCiAgIGRyYXcubGluZSgoaSppbWcuc2l6ZVswXS9udW0sIDAsIGltZy5zaXplWzBdLCBpKmltZy5zaXplWzFdL251bSksICgwLCAyNTUtaSwgMCkpCiAgIGRyYXcubGluZSgoKG51bS1pKSppbWcuc2l6ZVswXS9udW0sIGltZy5zaXplWzFdLCBpbWcuc2l6ZVswXSwgaSppbWcuc2l6ZVsxXS9udW0pLCAoMCwgMjU1LWksIDApKQogICAKICAgZHJhdy5saW5lKCgwLCAobnVtLWkpKmltZy5zaXplWzFdL251bSwgaSppbWcuc2l6ZVswXS9udW0sIDApLCAoMCwgMjU1LWksIDApKSAKICAgZHJhdy5saW5lKCgwLCAoaSkqaW1nLnNpemVbMV0vbnVtLCBpKmltZy5zaXplWzBdL251bSwgaW1nLnNpemVbMV0pLCAoMCwgMjU1LWksIDApKSAgCiAgIGktPTEKIApkZWwgZHJhdyAKIAojIHdyaXRlIHRvIHN0ZG91dAppbWcuc2F2ZShzeXMuc3Rkb3V0LCAmcXVvdDtQTkcmcXVvdDsp
import Image, ImageDraw, sys
dimensions = (400, 350)
img = Image.new("RGB", dimensions)
draw = ImageDraw.Draw(img)
num =148
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")