import tkinter as tk
from tkinter import ttk
root = tk.Tk()
def change():
img2 = tk.PhotoImage(file = "img2.png")
label.configure(image = img2)
img1 = tk.PhotoImage(file = "img1.png")
label = ttk.Label(root, image = img1)
label.place(x = 0, y = 0)
button = ttk.Button(root, text = "Change", command = change)
button.place(x = 20, y = 20)
This is my current code which has a button to change one image to another. The first image displays normally, however when the button is pressed tkinter just reverts to it's usual background. Please help this is driving me crazy
tk.mainloop()btw?