3.3.2 Image Class Static Methods
The following Image class static methods are defined in the
graphics module:
| Image.new( |
size[, mode='RGB16']) |
-
Creates and returns a new Image object with the given size and
mode. size is a two-element tuple. mode specifies the
color mode of the Image to be created. It can be one of the
following:
'1': Black and white (1 bit per pixel)
'L': 256 gray shades (8 bits per pixel)
'RGB12': 4096 colors (12 bits per pixel)
'RGB16': 65536 colors (16 bits per pixel)
'RGB': 16.7 million colors (24 bits per pixel)
It will also set the image size in twips according to the density of the device's primary screen.
-
Returns a new Image object (mode
RGB16) that contains the
contents of the named file. The supported file formats are JPEG and PNG. The
file format is automatically detected based on file contents.
filename should be a full path name.
-
Examines the given file and returns a dictionary of the attributes of the
file. At present the dictionary contains only the image size in pixels as a
two-element tuple, indexed by key
'size'.
filename should be a full path name.
Release 2.0.0 final , documentation updated on 10 Feb 2010.
See About this document... for information on suggesting changes.