Module Image
[frames | no frames]

Module Image

The Blender.Image submodule.

Image

New: Image.setFilename.

This module provides access to Image objects in Blender.

Example:
 import Blender
 from Blender import Image
 #
 image = Image.Load("/path/to/my/image.png")    # load an image file
 print "Image from", image.getFilename(),
 print "loaded to obj", image.getName())
 image.setXRep(4)                               # set x tiling factor
 image.setYRep(2)                               # set y tiling factor
 print "All Images available now:", Image.Get()

Classes
Image This object gives access to Images in Blender.

Function Summary
Blender Image or a list of Blender Images Get(name)
Get the Image object(s) from Blender.
Blender Image GetCurrent()
Get the currently displayed Image from Blenders UV/Image window.
Blender Image Load(filename)
Load the image called 'filename' into an Image object.
Blender Image New(name, width, height, depth)
Create a new Image object.

Function Details

Get(name=None)

Get the Image object(s) from Blender.
Parameters:
name - The name of the Image object.
           (type=string)
Returns:
It depends on the name parameter:
  • (name): The Image object called name, None if not found;
  • (): A list with all Image objects in the current scene.

           (type=Blender Image or a list of Blender Images)

GetCurrent()

Get the currently displayed Image from Blenders UV/Image window. When multiple images are displayed, the last active UV/Image windows image is used.
Returns:
The Current Blender Image, If there is no current image it returns None.
           (type=Blender Image)

Load(filename)

Load the image called 'filename' into an Image object.
Parameters:
filename - The full path to the image file.
           (type=string)
Returns:
A Blender Image object with the data from filename.
           (type=Blender Image)

New(name, width, height, depth)

Create a new Image object.
Parameters:
name - The name of the new Image object.
           (type=string)
width - The width of the new Image object, between 1 and 5000.
           (type=int)
height - The height of the new Image object, between 1 and 5000.
           (type=int)
depth - The colour depth of the new Image object. (8:Grey, 24:RGB, 32:RGBA). (Not implimented yet, all new images will be 24bit)
           (type=int)
Returns:
A new Blender Image object.
           (type=Blender Image)

Generated by Epydoc 2.1 on Thu Dec 22 22:38:14 2005 http://epydoc.sf.net