Change one or more configuration options.
Return the value of the given configuration option.
Returns the width (height) of the image, in pixels.
Returns the string "photo".
Fetch the pixel at the given position (where (0, 0) is in the upper left corner).
As of Python 1.5.2, this method returns a string containing one or three pixel components. Here's how to convert this string to either an integer or a 3-tuple of integers:
optionvalue = im.get(x, y) if type(value) == type(""): try: value = int(value) except ValueError: value = tuple(map(int, string.split(value)))
Write pixel data to the image.
Not supported in 1.5.2 or earlier.
Save the contents of the PhotoImage to a file using the given format. The following options can be used:
Table 35-1. PhotoImage Write Options
Option | Type | Description |
format | string | Specifies the format handler to use when writing this image. This is typically "gif" or "ppm". |
from_coords | tuple | Save only a part of the image. If a 2-tuple is given, write saves the rectangle between that position, and the lower right corner of the image. If a 4-tuple is given, it specifies which rectangle to save. |
Clears the image. The size is left as it is, but the contents are made completely transparent.
Duplicate the current PhotoImage instance.
Resize the image to (xscale*width, yscale*height) pixels, using nearest neighbor resampling. In other words, each pixel in the source image will be expanded to xscale*yscale pixels. If only one scale is given, it is used for both directions.
Resize the image to (xscale/width, yscale/height) pixels, using nearest neighbor resampling. If only one scale is given, it is used for both directions.