hyperspy.io_plugins.image module

hyperspy.io_plugins.image.file_reader(filename, **kwds)

Read data from any format supported by imageio (PIL/pillow). For a list of formats see https://imageio.readthedocs.io/en/stable/formats.html

Parameters
  • filename ({str, pathlib.Path, bytes, file}) – The resource to load the image from, e.g. a filename, pathlib.Path, http address or file object, see the docs for more info. The file format is defined by the file extension that is any one supported by imageio.

  • format (str, optional) – The format to use to read the file. By default imageio selects the appropriate for you based on the filename and its contents.

  • **kwds (keyword arguments) – Allows to pass keyword arguments supported by the individual file readers as documented at https://imageio.readthedocs.io/en/stable/formats.html

hyperspy.io_plugins.image.file_writer(filename, signal, **kwds)

Writes data to any format supported by imageio (PIL/pillow). For a list of formats see https://imageio.readthedocs.io/en/stable/formats.html

Parameters
  • filename ({str, pathlib.Path, bytes, file}) – The resource to write the image to, e.g. a filename, pathlib.Path or file object, see the docs for more info. The file format is defined by the file extension that is any one supported by imageio.

  • signal (a Signal instance) –

  • format (str, optional) – The format to use to read the file. By default imageio selects the appropriate for you based on the filename and its contents.

  • **kwds (keyword arguments) – Allows to pass keyword arguments supported by the individual file writers as documented at https://imageio.readthedocs.io/en/stable/formats.html