example - worksbut only for image types supported by the base tkinter toolkit to display other image formatssuch as jpegwe need to install pil and use its replacement photoimage object in terms of codeit' simply matter of adding one import statementas illustrated in example - example - pp \gui\pil\viewer-pil py ""show one image with pil photo replacement object handles many more image typesinstall pil firstplaced in lib\site-packages ""import ossys from tkinter import from pil imagetk import photoimage imgdir 'imagesimgfile 'florida- - jpgif len(sys argv imgfile sys argv[ imgpath os path join(imgdirimgfilewin tk(win title(imgfileimgobj photoimage(file=imgpathlabel(winimage=imgobjpack( tkinter tourpart <=use pil replacement class rest of code unchanged does gifjpgpngtiffetc now jpegs work