Resize Image

PHOTO EMBED

Mon May 31 2021 20:45:17 GMT+0000 (Coordinated Universal Time)

Saved by @mikek

from tkinter import *
from PIL import ImageTk, Image

root = Tk()
root.title("My Title")
root.geometry("500x500")
root.iconbitmap(r'icon.ico')

# Open image
my_img = Image.open("image.png")

# Resize Image
resized = my_img.resize((500, 500), Image.ANTIALIAS)


new_img = ImageTk.PhotoImage(resized)

# image size 1025x1025
my_label = Label(root, image=new_img)
my_label.pack(pady=20)

root.mainloop()
content_copyCOPY