I am trying to manipulate images using the python Pillow library (fork of PIL) and am facing some strange problem. For some reason, when I try to draw a line and draw some text with the same y coordinate, they do not match. The text is slightly below the line, but for me both charts start from the same point. Has anyone had this problem before and / or knew how to solve it? Here is the code I'm using:
image = Image.open("../path_to_image/image.jpg")
draw = ImageDraw.Draw(image)
font = ImageFont.truetype("../fonts/Arial Bold.ttf", 180)
draw.line((0,2400, 500,2400), fill="#FFF", width=1)
draw.text((0, 2400), "Test Text", font=font)
image.save(os.path.join(root, "test1.jpg"), "JPEG", quality=100)
return
source
share