# The PIL.ImageTk Module

The ImageTk module contains support to create and modify Tkinter BitmapImage and PhotoImage objects.

For examples, see the demo programs in the Scripts directory.

## Module Contents

BitmapImage(image=None, **options) (class) [#]

  Create a Tkinter-compatible bitmap image.

  For more information about this class, see The BitmapImage Class.

getimage(photo) [#]
PhotoImage(image=None, size=None, **options) (class) [#]

  Creates a Tkinter-compatible photo image.

  For more information about this class, see The PhotoImage Class.

## The BitmapImage Class

BitmapImage(image=None, **options) (class) [#]
__init__(image=None, **options) [#]

  Create a Tkinter-compatible bitmap image.

  The given image must have mode "1". Pixels having value 0 are treated as transparent. Options, if any, are passed on to Tkinter. The most commonly used option is foreground, which is used to specify the colour for the non-transparent parts. See the Tkinter documentation for information on how to specify colours.

  image
__str__() [#]
  Returns:
height() [#]
  Returns:
width() [#]
  Returns:

## The PhotoImage Class

PhotoImage(image=None, size=None, **options) (class) [#]
__init__(image=None, size=None, **options) [#]

  Create a photo image object. The constructor takes either a PIL image, or a mode and a size. Alternatively, you can use the file or data options to initialize the photo image object.

  image
  size
  file=
  data=
__str__() [#]
  Returns:
height() [#]
  Returns:
paste(im, box=None) [#]
  im
  box
width() [#]
  Returns: