Skip to content

Is there any way to place transparent images on a frame? #329

Answered by abhaymakes
kelltom asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can do this with the PIL module. Below is the implementation:

Import tkinter as tk
import customtkinter as ctk
from PIL import ImageTk, Image



root = ctk.CTk()

transparent_image = ImageTk.PhotoImage(Image.open("image-url/path"))

image_label = ctk.CTkLabel(root, image=transparent_image)
image_label.pack()

#Note : I'm not sure if CTkLabel has an image argument(CTkButton has one)
#if not : Then use this instead of CTkLabel
label = tk.Label(root, image = img)
label.pack()


root.mainloop()

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@abhaymakes
Comment options

@kelltom
Comment options

Answer selected by kelltom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants