How to insert an image in a Tkinter canvas item?

Tkinter canvas is the most versatile widget in the Tkinter library. It is used to create images, shapes, arcs, animating objects, and many more other works. In order to work and process the images, Python supports Pillow Package or PIL. We can add images in the canvas as the items using the create_image(width, height, image_location, options) method. We can also specify where the image should open in the window by defining the Positional arguments such as anchor(options) property.


#Import the required Libraries
from tkinter import *
from PIL import Image,ImageTk

#Create an instance of tkinter frame
win = Tk()

#Set the geometry of tkinter frame

#Create a canvas
canvas= Canvas(win, width= 600, height= 400)

#Load an image in the script
img= ImageTk.PhotoImage("download.png"))

#Add image to the Canvas Items



Run the above code to display the image in the canvas.