colour_hdri.utilities.image Module — Colour - HDRI 0.1.0 documentation

# colour_hdri.utilities.image Module

## Image Data & Metadata Utilities

Defines various image data and metadata utilities classes:

- `Metadata`
- `Image`
- `ImageStack`

class `colour_hdri.utilities.image.` `Metadata`

  Bases: `colour_hdri.utilities.image.Metadata`

  Defines the base object for storing exif metadata relevant to HDRI / radiance image generation.

  Parameters: | f_number (array_like) – Image FNumber. exposure_time (array_like) – Image Exposure Time. iso (array_like) – Image ISO. black_level (array_like) – Image Black Level. white_level (array_like) – Image White Level. white_balance_multipliers (array_like) – Image white balance multipliers, usually the As Shot Neutral matrix.

class `colour_hdri.utilities.image.` `Image`(path=None, data=None, metadata=None)

  Bases: `object`

  Defines the base object for storing an image along its path, pixel data and metadata needed for HDRI / radiance images generation.

  Parameters: | path (unicode, optional) – Image path. data (array_like, optional) – Image pixel data array. metadata (Metadata, optional) – Image exif metadata.

  `path`
  `data`
  `metadata`
  `read_data`()
  `read_metadata`()
  `data`

    Property for self.__data private attribute.

    Returns: | self.__data.
    Return type: | unicode

  `metadata`

    Property for self.__metadata private attribute.

    Returns: | self.__metadata.
    Return type: | unicode

  `path`

    Property for self.__path private attribute.

    Returns: | self.__path.
    Return type: | unicode

  `read_data`()

    Reads image pixel data at `Image.path` attribute.

    Returns: | Image pixel data.
    Return type: | ndarray

  `read_metadata`()

    Reads image relevant exif metadata at `Image.path` attribute.

    Returns: | Image relevant exif metadata.
    Return type: | Metadata

class `colour_hdri.utilities.image.` `ImageStack`

  Bases: `_abcoll.MutableSequence`

  Defines a convenient stack storing a sequence of images for HDRI / radiance images generation.

  `ImageStack`()
  `__init__`()
  `__getitem__`()
  `__setitem__`()
  `__delitem__`()
  `__len__`()
  `__getattr__`()
  `__setattr__`()
  `insert`()
  `from_files`()
  `__delitem__`(index)

    Reimplements the `MutableSequence.__delitem__()` method.

    Parameters: | index (int) – Item index.

  `__getattr__`(attribute)

    Reimplements the `MutableSequence.__getattr__()` method.

    Parameters: | attribute (unicode) – Attribute to retrieve the value.
    Returns: | Attribute value.
    Return type: | object

  `__getitem__`(index)

    Reimplements the `MutableSequence.__getitem__()` method.

    Parameters: | index (int) – Item index.
    Returns: | Item at given index.
    Return type: | Image

  `__len__`()

    Reimplements the `MutableSequence.__len__()` method.

  `__setattr__`(attribute, value)

    Reimplements the `MutableSequence.__getattr__()` method.

    Parameters: | attribute (unicode) – Attribute to set the value. value (object) – Value to set.

  `__setitem__`(index, value)

    Reimplements the `MutableSequence.__setitem__()` method.

    Parameters: | index (int) – Item index. value (int) – Item value.

  static `from_files`(image_files)

    Returns a `ImageStack` instance with given image files.

    Parameters: | image_files (array_like) – Image files.
    Returns: |
    Return type: | ImageStack

  `insert`(index, value)

    Reimplements the `MutableSequence.insert()` method.

    Parameters: | index (int) – Item index. value (object) – Item value.