
|
Python Imaging Library Reference Notes
- The official reference is here.
ImageTK module
BitmapImage(image, foreground="color")
Convert an image into a bitmap
PhotoImage(image)
Turns any image format (jpg, png, etc.) into a Tkinter compatible image
Image module
img.open(filename)
img.save(outfile, format) If format omitted, bases file type on extension of filename
img.resize(size) size in (height, width) as a tuple
img.rotate(angle) rotates image counter-clockwise around the center
img.thumbnail(size) creates a thumbnail of the image
ImageEnhance module
ImageFilter module
- NOTE: These are predefined routines to use with the
filter method of the Image class. A sample code would look like: img.filter(ImageFilter.BLUR).
- BLUR
- CONTOUR
- DETAIL
- EDGE_ENHANCE
- EDGE_ENHANCE_MORE
- EMBOSS
- FIND_EDGES
- SMOOTH
- SMOOTH_MORE
- SHARPEN
Restricted access |