Image in Tkinter Label? Image in Tkinter Label? tkinter tkinter

Image in Tkinter Label?


For debugging purpose try to avoid the use of PIL and load some *.gif (or another acceptable) file directly in PhotoImage, like shown below, if it'll work for you then just convert your image in *.gif or try to deal with PIL.

from tkinter import *def make_label(parent, img):    label = Label(parent, image=img)    label.pack()if __name__ == '__main__':    root = Tk()    frame = Frame(root, width=400, height=600, background='white')    frame.pack_propagate(0)        frame.pack()    img = PhotoImage(file='logo.gif')    make_label(frame, img)    root.mainloop()


       img = Image.open('image_name')       self.tkimage = ImageTk.PhotoImage(img)       Label(self,image = self.tkimage).place(x=0, y=0, relwidth=1, relheight=1)