# collada.material.CImage

class `collada.material.``CImage`(id, path, collada=None, xmlnode=None)

  Bases: `collada.common.DaeObject`

  Class containing data coming from a <image> tag.

  Basically is just the path to the file, but we give an extended functionality if PIL is available. You can in that case get the image object or numpy arrays in both int and float format. We named it CImage to avoid confusion with PIL’s Image class.

  `__init__`(id, path, collada=None, xmlnode=None)

    Create an image object.

    Parameters:

    - id (str) – A unique string identifier for the image
    - path (str) – Path relative to the collada document where the image is located
    - collada (collada.Collada) – The collada object this image belongs to
    - xmlnode – If loaded from xml, the node this data comes from

  Methods

  `__init__`(id, path[, collada, xmlnode]) | Create an image object.
  `load`(collada, localspace, node) | Load and return a class instance from an XML node.
  `save`() | Saves the image back to `xmlnode`.

  Attributes

  `data` | Raw binary image file data if the file is readable.
  `floatarray` | Numpy float array (height, width, nchannels) with the image data normalized to 1.0.
  `pilimage` | PIL Image object if PIL is available and the file is readable.
  `uintarray` | Numpy array (height, width, nchannels) in integer format.

  `id` = None

    The unique string identifier for the image

  `path` = None

    Path relative to the collada document where the image is located

  `xmlnode` = None

    ElementTree representation of the image.

  `data`

    Raw binary image file data if the file is readable. If aux_file_loader was passed to `collada.Collada.__init__()`, this function will be called to retrieve the data. Otherwise, if the file came from the local disk, the path will be interpreted from the local file system. If the file was a zip archive, the archive will be searched.

  `pilimage`

    PIL Image object if PIL is available and the file is readable.

  `uintarray`

    Numpy array (height, width, nchannels) in integer format.

  `floatarray`

    Numpy float array (height, width, nchannels) with the image data normalized to 1.0.

  static `load`(collada, localspace, node)

    Load and return a class instance from an XML node.

    Inspect the data inside node, which must match this class tag and create an instance out of it.

    Parameters:

    - collada (collada.Collada) – The collada file object where this object lives
    - localscope (dict) – If there is a local scope where we should look for local ids (sid) this is the dictionary. Otherwise empty dict ({})
    - node – An Element from python’s ElementTree API

  `save`()

    Saves the image back to `xmlnode`. Only the `id` attribute is saved. The image itself will have to be saved to its original source to make modifications.