Jun-01-2021, 10:16 PM
O
I thought that was going to fix it but it's good that you got rid of the * imports 
When calling paste I think the passed in image has to be an actual PIL image.
as
Here is what I hope will fix it
When you make


self.overlay_img = ImageTk.PhotoImage(file=file)
self.overlay_img
is a Tkinter-compatible photo imageself.photo = ImageTk.PhotoImage(image=Image.fromarray(frame))
self.photo
is also a Tkinter-compatible photo imageWhen calling paste I think the passed in image has to be an actual PIL image.
self.photo.paste(self.overlay_img, (0, 0))
as
self.overlay_img
is used in the update method You probably need to keep self.overlay_img as it isdef update(self): ... ... if self.overlay_img: #self.canvas.tag_raise(self.overlay_img) self.canvas.create_image(0,0, image=self.overlay_img, anchor=NW)
Here is what I hope will fix it

When you make
self.overlay_img
try also making a pill imagedef overlay(self): file = filedialog.askopenfile( mode='rb', defaultextension='.png',title="Choose Overlay Image", filetypes=[("PNG Files", '*.png')]) if file: self.overlay_img = ImageTk.PhotoImage(file=file) self.pil_overlay_img = Image.open(file)Then change
if isTrue and self.overlay_img: self.photo.paste(self.overlay_img, (0, 0))to
if isTrue and self.pil_overlay_img: self.photo.paste(self.pil_overlay_img, (0, 0))