photoimage and its cousinbitmapimageessentially load graphics files and allow those graphics to be attached to other kinds of widgets to open picture filepass its name to the file attribute of these image objects though simpleattaching images to buttons this way has many usesin for instancewe'll use this basic idea to implement toolbar buttons at the bottom of window canvas widgets--general drawing surfaces covered in more detail in the next can display pictures too though this is bit of preview for the upcoming basic canvas usage is straightforward enough to demonstrate hereexample - renders figure - (shrunk here for display)example - pp \gui\tour\imgcanvas py gifdir /gifs/from tkinter import win tk(img photoimage(file=gifdir "ora-lp gif"can canvas(wincan pack(fill=bothcan create_image( image=imganchor=nwwin mainloop(xy coordinates buttons are automatically sized to fit an associated photobut canvases are not (because you can add objects to canvas lateras we'll see in to make canvas fit the picturesize it according to the width and height methods of image objectsas in example - this version will make the canvas smaller or larger than its default size as neededlets you pass in photo file' name on the command lineand can be used as simple image viewer utility the visual effect of this script is captured in figure - images