I'm trying to resize and apply antialiasing to an image I previously displayed in Tkinter. I'm reading it from a url. The problem is, I opened the image with tkinter.PhotoImage, and the resize() function I need is in PIL.Image. I'd like to know if there's a way to convert from one to another, or some other way I can resolve this issue.
Here's the code:
import tkinter
from urllib.request import urlopen
import base64
from PIL import Image
window = tkinter.Tk()
url = "https://s.yimg.com/os/weather/1.0.1/shadow_icon/60x60/partly_cloudy_night@2x.png"
b64_data = base64.encodestring(urlopen(url).read())
image = tkinter.PhotoImage(data=b64_data)
# Function I need:
#image = image.resize((100, 100), Image.ANTIALIAS)
label = tkinter.Label(image=image)
label.pack()
window.mainloop()
If there's a completely different way I can achieve this, I'd like to hear it.