How to change the size of the image in Tkinter?

from tkinter import Tk, Button, Label, PhotoImage
root = Tk()
root.title("")
root.geometry("250x150")
im = PhotoImage(file='D:/Py/x.png')
label = Label(image=im)
label.pack()
root.mainloop()
April 7th 20 at 10:39
1 answer
April 7th 20 at 10:41
from livewires import games
games.init(screen_width = 640, screen_height = 480)
wall_image = games.load.image('wall.jpg', transparent = False)
games.screen.background = wall_image
Photo_name = games.load_image('photo_name.bmp')
photo = games.Sprite(image = Photo_name, x = 320, y = 240)
games.screen.add(photo)
games.screen.mainloop()

this is for the game.
But for other apps:
from Tkinter import *
import tkFont
from PIL import Image

image = Image.open(Image_Location)
image = image.resize((250, 250), Image.ANTIALIAS) ## The (250, 250) is (height, width)
self.pw.pic = ImageTk.PhotoImage(image)
And without any extra libraries? - saul.Lueilwitz commented on April 7th 20 at 10:44
@saul.Lueilwitz, maybe, but I use it) Look online, but PIL and the best in my opinion - mossie.Collier61 commented on April 7th 20 at 10:47
@mossie.Collier61how to write only with PIL and Tkinter (without TKfont)? - saul.Lueilwitz commented on April 7th 20 at 10:50

Find more questions by tags PythonImagesTkinter