Answers for "how to show pil images in tk"

2

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()
Posted by: Guest on October-02-2020
1

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”.
Posted by: Guest on May-02-2021

Browse Popular Code Answers by Language