0

I tried to put a picture into my Tkinter window,that worked,but the picture was waaaay to big,so I tried it with this:

img = PhotoImage(file=r"C:\\Users\\ulric\\Desktop\\PNG_transparency_demonstration_2.png")
label2 = Label(window, image=img,height = "200px",width="200px")
label2.grid(row=0, column=1)

But all that did was to crop the picture and that isn't what I wanted,I just want to make the picture smaller. Could someone please help me? That would be very nice...

  • You can use the pillow library for this: https://pillow.readthedocs.io/en/latest/reference/Image.html#PIL.Image.Image.thumbnail also see this question: https://stackoverflow.com/questions/273946/how-do-i-resize-an-image-using-pil-and-maintain-its-aspect-ratio – Wups Feb 01 '22 at 09:00
  • Load the image with `Image.open` and then you can resize and give out the final item to the `ImageTk.PhotoImage`. – Delrius Euphoria Feb 01 '22 at 09:31

0 Answers0