importing future behavior in python the following import allows us to use python ' division behavior from __future__ import division there are many other things you can import from the future the python imaging library the python imaging library (pilcontains useful tools for working with images as of this writingthe pil is only available for python or earlier the pil is not part of the standard python distributionso you'll have to download and install it separately it' easy to installthough pil hasn' been maintained since but there is project called pillow that it nearly compatible with pil and works in python and later we will cover just few features of the pil here good reference is the python imaging library handbook using images other than gifs with tkinter tkinteras we've seencan' use jpegs and pngs but it can if we use it in conjunction with the pil here is simple examplefrom tkinter import from pil import imageimagetk root tk(cheetah_image imagetk photoimage(image open'cheetah jpg ')button button(image=cheetah_imagebutton grid(row= column= mainloop(the first line imports tkinter remember that in python it' an uppercase tkinter the next line imports few things from the pil nextwhere we would have used tkinter' photoimage to load an imagewe instead use combination of two pil functions we can then use the image like normal in our widgets images pil is the python imaging libraryand so it contains lot of facilities for working with images we will just show simple example here the program below displays photo on canvas and when the user clicks buttonthe image is converted to grayscale from tkinter import from pil import imageimagetk def change()global imagephoto pix image load(