PyDocs

Nav

Graphical user interfaces with Tk

PhotoImage

tkinter

class
  • PhotoImage(name=None, cnf={}, master=None, **kw)
A full-color image (the Tk photo image type), stored internally with a varying degree of transparency per pixel. It can read and write GIF, PPM/PGM and (in Tk 8.6 and later) PNG files, read SVG files (in Tk 9.0 and later), and be drawn in widgets. Inherits from Image.
Members of PhotoImage

b

blank
Blank the image; that is, set the entire image to have no data, so that it is displayed as transparent and the background of whatever window it is displayed in shows through.

c

cget
Return the current value of the configuration option option.
copy
Return a new PhotoImage with a copy of this image.
copy_replace
Copy a region from sourceImage (which must be a PhotoImage) into this image, possibly with pixel zooming and/or subsampling.

d

data
Return the image data.

g

get
Return the color of the pixel at coordinates (x, y) as an (r, g, b) tuple of three integers between 0 and 255, representing the red, green and blue components respectively.

p

put
Set pixels of the image to the colors given in data, which must be a string or a nested sequence of horizontal rows of pixel colors (for example "{red green} {blue yellow}").

r

read
Read image data from the file named filename into the image.

s

subsample
Return a new PhotoImage based on this image but using only every x-th pixel in the X direction and every y-th pixel in the Y direction.

t

transparency_get
Return True if the pixel at coordinates (x, y) is fully transparent, False otherwise.
transparency_set
Make the pixel at coordinates (x, y) fully transparent if boolean is true, fully opaque otherwise.

w

write
Write image data from the image to the file named filename.

z

zoom
Return a new PhotoImage with this image magnified by a factor of x in the X direction and y in the Y direction.
0 Examples
No examples for tkinter/PhotoImage.
See Also
No see-alsos for tkinter/PhotoImage
0 Notes
No notes for PhotoImage