Welcome to imread’s documentation!

Imread is a very simple library, with a small number of functions:

imread()

Reads an image file

imread_multi()

Reads all the images in a multi-image file (TIFF and STK)

imread_from_blob()

Reads an image from a bytes object in memory

imsave()

Writes an image file

imsave_multi()

Writes several images into a single file (TIFF only)

detect_format()

Detects the format of a file or blob from its magic number (PNG and JPEG only)

supports_format()

Checks whether a format is supported

imload, imload_multi, imload_from_blob, imwrite and imwrite_multi are aliases. The imread.ijrois module reads ImageJ regions of interest (see Formats Supported). All of them are documented in the API Reference.

It is meant to be used with a computer vision & image processing package, such as:

This grew out of frustration at current image loading solutions in Python, in either my packages [mahotas] or packages from others [scikit-image, for example].

The relationship with NumPy is very contained, so this could easily be repurposed to load images in other frameworks, or even in other programming languages.

Citation

This package is an offshoot of mahotas. As it does not currently have its own publication, you are asked to cite the parent package. If you use mahotas-imread in a scientific publication, please cite:

Luis Pedro Coelho Mahotas: Open source software for scriptable computer vision in Journal of Open Research Software, vol 1, 2013. [DOI]

In BibTeX format:

@article{mahotas,
    author = {Luis Pedro Coelho},
    title = {Mahotas: Open source software for scriptable computer vision},
    journal = {Journal of Open Research Software},
    year = {2013},
    doi = {10.5334/jors.ac},
    month = {July},
    volume = {1}
}

Installation

The recommended way to install imread is with pixi:

pixi add imread

Binary wheels are also available with pip install imread. See How To Install Mahotas-imread for all the options, including building from source.

Contents:

Bug Reports

Please report any bugs either on GitHub or by email to luis@luispedro.org.

If you have a test case where you are not sure whether imread is behaving correctly, you can discuss it on the pythonvision mailing list.

If at all possible, include a small image as a test case.

Indices and tables