How do I change the resolution of an image in Tkinter?

Viewed 187

I wish to change the resolution of an image before displaying it. when I use this code:

from tkinter import *
from PIL import ImageTk, Image
...
my_image = my_image.resize((128, 128), Image.ANTIALIAS)

I get the message:

AttributeError: 'PhotoImage' object has no attribute 'resize'

What do I do wrong?

1 Answers

You can try this:

PIL.Image.open('Your image location').resize(128,128)
Related