may you help me ?
I'm trying to make a software in python. I'm using tkinter and pil for training purposes.
I want to be able to create an empty image with PIL, draw on it and then make it appear with tkinter.
for now I have this
def redraw(self):
self.canvas.delete("all")
image = Image.new ('RGB', (100, 100))
draw = ImageDraw.Draw(image)
draw.rectangle ((0,0,100,100), fill = (20,20,20) )
im = ImageTk.PhotoImage (image)
self.canvas.create_rectangle (0,0, 100, 100) #appears
self.canvas.create_image (0,0, image = im) #does not
Almost like the image created would be transparent.
Even if I add image.save("image.png", "PNG")
which create an image with my desired gray rectangle.
Has anyone seen my flaw ?
Thank you dearly for your help.