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:

It will also set the image size in twips according to the density of the device's primary screen.

Image.open( filename)
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.

Image.inspect( filename)
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.

See About this document... for information on suggesting changes.