1from PIL import Image, ImageDraw
2
3with Image.open("hopper.jpg") as im:
4
5 draw = ImageDraw.Draw(im)
6 draw.line((0, 0) + im.size, fill=128)
7 draw.line((0, im.size[1], im.size[0], 0), fill=128)
8
9 # write to stdout
10 im.save(sys.stdout, "PNG")
11