I want to add a button which can load next image file and display it to canvas. Here is the code that I have done until now. Can anyone help to add next button?
from tkinter import filedialog
from tkinter import *
from PIL import ImageTk,Image
root = Tk()
openfile = filedialog.askopenfilename(initialdir = "/",title = "Select file",filetypes = (("jpeg files","*.jpg"),("all files","*.*")))
img = ImageTk.PhotoImage(Image.open(openfile))
wh = img.width()
ht = img.height()
w = Canvas(root, width=wh, height=ht, bg='black')
w.pack(expand = YES)
w.create_image(0, 0, anchor=NW, image = img)
B = Button(root, text="next")
B.place(x=50, y=50)
root.mainloop()