for my program I need to place an transparent image on top of multiple frames (as a kind of overlay), and apparently, placing the image in a canvas is a good way to do it as they support transparency. However, the canvas has a non-transparent border around it, which means it just sits on top of the frames with a a gray rectangular background around it, and I have no clue how to fix it:
from tkinter import *
root = Tk()
root.title("Transparency")
root.geometry("500x500")
frame = Frame(root, width=500, height=500, bg="yellow")
frame.place(x=0, y=0)
photoimage = PhotoImage(file="example1.png")
canvas = Canvas(frame, width=300, height=200, bg="red")
canvas.create_image(128, 64, image=photoimage)
canvas.place(x=100, y=100)
root.mainloop()
This is not my actual program, but it does replicates what happens. I also need to use the Place manager instead of the others (my program uses a lot of coordinates to place several widgets). This is what it looks like when running the above code
This is what I want it to look like (assume the yellow underneath the image are a bunch of frames).
All I am trying to do is place a transparent Canvas on top of opaque Frames, and it should be impossible to tell that the Canvas is even present.
How do I accomplish this?