show image in tkinter pillow
import tkinter as tk
from PIL import Image, ImageTk
root = tk.Tk()
img = Image.open("path//to//imgage.jpg")
img = img.resize((250, 250))
tkimage = ImageTk.PhotoImage(img)
tk.Label(root, image=tkimage).grid()
show image in tkinter pillow
import tkinter as tk
from PIL import Image, ImageTk
root = tk.Tk()
img = Image.open("path//to//imgage.jpg")
img = img.resize((250, 250))
tkimage = ImageTk.PhotoImage(img)
tk.Label(root, image=tkimage).grid()
what is imageTk in pil python
The ImageTk module contains support to create
and modify Tkinter BitmapImage and PhotoImage objects
from PIL images. ... This can be used everywhere Tkinter expects an image object. The given image must have mode “1”.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us