Answer the question
In order to leave comments, you need to log in
How to find out the size of an image in python tkinter through changes to PhotoImage?
how do i know the size of an image through PhotoImage?
my code:
from tkinter import *
win = Tk()
картинка = PhotoImage(file="C:\питон.gif")]
new_image = картинка.zoom(4, 4)
my_image = new_image.subsample(3, 3)
print(int(my_image.width))
and error: TypeError: int() argument must be a string, a bytes-like object or a number, not 'method'Answer the question
In order to leave comments, you need to log in
my_image.width
- the method, which is what the error says. ()
Add brackets . Well, it already returns a number, so int is not needed
from PIL import Image
img = Image.open(src)
(width, height) = img.size
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question