what image types can tkinter use code example
Example 1: tkinter load image
from tkinter import *
from PIL import ImageTk, Image
root = Tk()
c = Canvas(root, width=500, height=500)
c.pack()
img = ImageTk.PhotoImage(Image.open(r"imagepath\imagename.extension"))
c.create_image(x, y, image=img, anchor=NW)
Example 2: make image to string to use in tkinter
import base64
with open("path/to/image.png", "rb") as image_file:
image_data_base64_encoded_string = base64.b64encode(image_file.read())