Composition

Description

This section contains functions related to the manipulation of the properties of images. This includes its dimensions and file type among other properties. In other words, most functions in this section modify the structure of images rather than their contents.

Function List

pyifx.comp.change_file_type(img_paths, new_type, write=True)

Takes image(s) and converts them to a given file type.

Parameters:
  • img_paths (pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list) – The image(s) to be converted.
  • new_type (str) – The file type that the image(s) should be converted to. Available types: PNG, JPG, JPEG. Can be entered with/without the dot. Parameter is case-insensitive.
  • write (bool) – Whether to write the converted image(s).
Returns:

PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage

Return type:

pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list

pyifx.comp.resize(img_paths, new_size, write=True)

Takes image(s) and converts them to a given size.

Parameters:
  • img_paths (pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list) – The image(s) to be resized.
  • new_size (str) – The new size to convert the image(s) to. It must be entered in the form “WidthxHeight”.
  • write (bool) – Whether to write the resized image(s).
Returns:

PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage

Return type:

pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list

pyifx.comp.rewrite_file(img_paths)

Takes image(s) and writes them to an output destination based on their properties. Intended for use with changes to pyifx class instances.

Parameters:img_paths (pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list) – The image(s) to be rewritten.
Returns:PyifxImage instance, ImageVolume instance, or list with elements of type PyifxImage
Return type:pyifx.misc.PyifxImage, pyifx.misc.ImageVolume, list