I am trying to place an image resized with PIL in a tkinter.PhotoImage object.
import tkinter as tk # I use Python3
from PIL import Image, ImageTk
master = tk.Tk()
img =Image.open(file_name)
image_resized=img.resize((200,200))
photoimg=ImageTk.PhotoImage(image_resized)
However, when I later try to call
photoimg.put( "#000000", (0,0) )
I get an
AttributError: 'PhotoImage' object has no attribute 'put'
While this:
photoimg=tk.PhotoImage(file=file_name)
photoimg.put( "#000000", (0,0))
doesn't raise an error. What am I doing wrong?