PIL ImageDraw.Draw() does not draw the line at all

Viewed 337

i have this function:

def check(user, number):
    for cartella in all_:
        if number in cartella:
            imgg = Image.open("layout {}.png".format(user))
            drawer = ImageDraw.Draw(imgg)
            drawer.line(coords[cartella.index(number)], fill=128, width=5)
            imgg.show()

which should draw a black line on the image at given coordinates, but it doesn't; i checked with

print(coords[cartella.index(number)]) 

and the coordinates gets recieved correctly by the function, what am i doing wrong?

1 Answers

Try making the value of the fill parameter a tuple. For example (0, 0, 0)

drawer.line(coords[cartella.index(number)], fill=(0, 0, 0), width=5)
Related