Using PIL with Tkinter

The ImageTk module provides two classes, BitmapImage and Photolmage, that create Tkinter-compatible bitmaps and images that can be used anywhere Tkinter expects a bitmap (black-and-white image) or image (color image). Not only can you then use PIL's image processing features in any Tkinter program, you can also use it to load image formats that Tkinter doesn't understand.

Refer to Chapters 19 and 20 for coverage of Tkinter.

PIL also has functions for creating a Windows-compatible bitmap (DIB) that can be drawn into a Windows device context, and functionality for writing images out to PostScript files or printers.

0 0

Post a comment