from PIL import Image, ImageDraw im = Image.new('RGB', (600, 400), (255, 255, 255)) draw = ImageDraw.Draw(im) draw.line((200, 200, 300, 300), fill=(0, 0, 255), width=20) im.save('kep.jpg', quality=95)