I am trying to add a small icon next to one of my buttons for my app, however when I import the image and place it in the window it is just a grey box. The image I am adding is not transparent and in a jpg format, I have tried a png format also, ideally I would want it to accept a transparent png. My window has 2 frames, one for the side bar and one for the main screen. I am using customtkinter library, which makes tkinter look better (https://github.com/TomSchimansky/CustomTkinter). The image is in the same directory as the py file. The following is my code and images of the GUI before and after adding the code for the image.
code:
home_button = customtkinter.CTkButton(left_frame, text="Home", width=195, height=40,
corner_radius=10,
text_font=["", "16"],
fg_color=["#ffffff", "#000000"],
hover_color=["#f4f5fa", "#1d1e20"],
command=home
)
home_button.place(x=50, y=80)
home_button.text_label.grid(sticky="w")
home_ico = ImageTk.PhotoImage(Image.open("home_def.jpg"))
home_label = Label(image=home_ico)
home_label.place(x=20, y=80)