from tkinter import *
from PIL import ImageTk
from PIL import Image
import cv2
def on3_button():
url = 'my url'
while True:
imgResp = urllib.request.urlopen(url)
imgNp = np.array(bytearray(imgResp.read()), dtype=np.uint8)
img = cv2.imdecode(imgNp, -1)
cv2.imshow('test', img)
if ord('q') == cv2.waitKey(10):
break
Second code
root.geometry("1920x1080+0+0")
background = ImageTk.PhotoImage(Image.open("D:\Telegrambotphotos\Ard.jpg"))
rootBack = Label(root, image=background)
rootBack.place(x=0, y=0, width=1920, height=1080)
photoSUp = ImageTk.PhotoImage(Image.open("E:\\python\\control interface\\illis\\mid-01.png"))
rootMid = Label(root, image=photoSUp)
rootMid.place(x=1495, y=513)
Button(rootMid, image = photoSUp,).pack(side = LEFT)