How To Resize Images With Tkinter - Python Tkinter GUI Tutorial #77

preview_player
Показать описание
In this video I'll show you how to resize an Image with Tkinter.

Resizing images in Tkinter isn't as easy as you'd think. We need to use the Pillow library to open the image, then resize it, and then use it in a label or button or however you'd normally use it.
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:

Codemycom
Автор

I needed this as I'm making an app for myself that converts images to any commonly used image formats that I downloaded from browsers.

The problem was when I wanted to show a preview of the image selected for conversion. This video helped me a lot!

bhoot
Автор

Made a Bank Management app Using Tkinter. Thank you Sir for 5 hours course .Really Helpful❤

kashishrana
Автор

I always wondered how to do this - thanks for covering this :D

gloryness
Автор

bro i was looking your course on fCC and this was the only thing missing thank you very much for doing this follow up.

liopo
Автор

Hit that like button Python Fans! Great tutorial. Feed the Algorithm!

RyanDanielG
Автор

Thank you sir for this video 😊😊😊😊
Your student from India 😊

umeshdhoke
Автор

this is most timely, i have a couple images in my program that i have been battling with to get the right size image, perfect

sovereignlivingsoul
Автор

The most satisfying feeling is when you finally get a code to work

imam
Автор

thank you so much sir, this has helped me a lot in my gui

sheetalgupta
Автор

Can you please make a video on how to add border in image and resize it like when u insert image in ms word and the one using the app can resize it from dragging its borders

rushaan
Автор

Im trying this way
But with any size I run it shows a white window there is no pictures
Or maybe the size is too high or ....?

Anish_
Автор

many thanks!!
for some, if you get IMAGE class don't have type open error :(
use this method,
import PIL.ImageTk
import PIL.Image

#open image

#resize
resized = logo1.resize((250, 160), PIL.Image.ANTIALIAS)
new_pic =
logo_label = tk.Label(root, image = new_pic)
logo_label.grid(row=0, column=0)

rajivram
Автор

Sir please explain how to zoom in and zoom out browsed png image using tkinter

balajir
Автор

you are soo good keep up and thank you

jawherballoumi
Автор

you can simplify this to one line: new_pic = ImageTK.PhotoImage(Image.open("images/aspen.png").resize((300, 225), Image.ANTIALIAS)) you can do this if you want less lines of code for the resize

luckeyduckey
Автор

@Codemy pls help how to resize toplevel image

shubhanshusharma
Автор

Thanks sir
Helped a lot in my school project

sakhshamchhibber
Автор

cool video. is there any way of resizing the image with the mouse (kind of like resizing images in google docs)?

martinwestin
Автор

Can someone help? I keep getting "AttributeError: '_io.TextIOWrapper' object has no attribute 'resize'" error.

TheGoldenPro