Skip to main content

imread: Image reading library

Project description

https://api.travis-ci.com/luispedro/imread.png https://anaconda.org/conda-forge/imread/badges/license.svg https://anaconda.org/conda-forge/imread/badges/installer/conda.svg https://anaconda.org/conda-forge/imread/badges/downloads.svg

IO with images and numpy arrays.

Mahotas-imread is a simple module with a small number of functions:

imread

Reads an image file

imread_multi

Reads an image file with multiple images. Currently, TIFF and STK (a TIFF sub-based format) support this function.

imsave

Writes an image file

Example (which uses mahotas for Gaussian filtering):

from imread import imread, imsave
from mahotas import gaussian_filter
lena = imread('lena.jpeg')

lena = gaussian_filter(lena.astype(float), 4.)
imsave('lena-filtered.jpeg', lena)

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 and this could be easily repurposed to load images in other frameworks, even other programming languages.

Online documentation

Python versions 2.6, 2.7, 3.3+ are officially supported.

Python 3.2 (and earlier versions in the Python 3 series) are officially not supported. Patches will be accepted if they do not mess up anything else, but bug reports will not be considered as very high priority.

Citation

If you use imread on a published publication, please cite the main mahotas paper (imread is a spin-off of mahotas):

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 = {http://dx.doi.org/10.5334/jors.ac},
    month = {July},
    volume = {1}
}

Installation/Dependencies

The easiest environment to install mahotas-imread is anaconda, through conda-forge. Just use:

conda config --add channels conda-forge
conda install imread

To compile on debian/ubuntu:

sudo apt-get install libpng12-dev libtiff4-dev libwebp-dev
sudo apt-get install xcftools

To compile on Mac:

sudo port install libpng tiff webp

Either way, you can then compile with:

python setup.py build

and install with:

python setup.py install

On Windows, you can also just download a pre-built package from C. Gohlke’s repository

On nix, you can use:

nix-env -iA nixpkgs.python27Packages.imread

or use the pkgs.python27Packages.imread object in your *.nix files.

Version 0.7.3 (2020-04-09)

  • Add missing test data to distribution

Version 0.7.2 (2020-03-24)

  • Fix several memory access bugs in parsers (reported by Robert Scott)

Version 0.7.1 (2019-05-09)

  • Fix 16-bit RGB/RGBA TIFF write (patch by Tomi Aarnio)

Version 0.7.0 (2018-09-30)

  • Add support for reading ImageJ ROIs

Version 0.6.1 (2018-02-15)

  • Support pathlib paths as function arguments

  • Fix 16 bit PNG write support (patch by Tomi Aarnio)

Version 0.6 (2016-09-21)

  • Add supports_format function

  • Make png compression level tunable when calling imsave

  • Add imsave_multi

  • Add partial support for reading PNG files in Gray+alpha format

Version 0.5.1 (2014-11-06)

  • Improve tests to work after installation

  • Fix compilation in MSVC (patch by Christoph Gohlke)

Version 0.5 (2014-10-16)

  • Add magic-number based format auto-detection

  • Auto detect whether webp is installed

  • Fix WebP reading (update to newer API)

Version 0.4 (2014-07-21)

  • Add configuration for TIFF saving

  • Correctly save 16 bit PNG images

  • Better error messages for JPEG

Version 0.3.2 (2013-10-06)

  • Added imload*/imwrite synonyms as suggested by Thouis (Ray) Jones

  • Options framework

  • Allow user to specify JPEG quality when saving

  • Fix loading of 16 bit PNG images

Version 0.3.1 (2013-06-20)

  • Fix possible crash on error with TIFF

  • Fix compilation on Windows (reported by Volker Hilsenstein)

  • Make it easy to compile without WebP

Version 0.3.0 (2013-07-29)

  • Support for reading from in-memory blobs

  • Support for reading & writing TIFF metadata

  • Add PHOTOMETRIC tag to TIFF (reported by Volker Hilsenstein)

  • Support writing RGB TIFFs

Version 0.2.6 (2013-06-19)

  • Fix hard crash when saving with non-existing file type

  • Fix compilation on MacOS (patch by Alexander Bohn)

  • Add verbose argument to tests.run()

  • Better error when attempting to save floating point images

Version 0.2.5 (2012-10-29)

  • Correctly accept uppercase extensions

  • Python 3 support (patch by Christoph Gohlke [pull request 8 on github])

  • Read 1-Bit PNGs

  • Read simple BMPs (compression and many bit types not supported)

  • More complete debug mode (export DEBUG=2 when building), more checks

Version 0.2.4 (2012-06-26)

  • Add lzw.cpp to source distribution

  • Support saving 16-bit TIFF

  • Better Mac OS support (patch from Alexander Bohn)

Version 0.2.3 (2012-06-8)

  • Fix imread_multi

Version 0.2.2 (2012-06-5)

  • Add formatstr argument to imread

  • Open files in binary mode on Windows (patch by Christoph Gohlke)

  • Read-only support for LSM files

  • Read-only support for XCF files (through xcf2png)

  • Fix writing of non-contiguous images (at least PNG was affected)

Version 0.2.1 (2012-02-11)

  • Add missing files to distribution

Version 0.2 (2012-03-19)

  • Compile on MSVC++ (Patches by Christoph Gohlke)

  • Support for WebP

  • Support for 1-bit TIFFs

  • Better error message

  • Support for multi-page TIFF reading

  • Experimental read-only support for STK files

Version 0.1 (2012-02-28)

  • Support for PNG

  • Support for TIFF

  • Support for JPEG

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imread-0.7.4.tar.gz (151.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

imread-0.7.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

imread-0.7.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

imread-0.7.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

imread-0.7.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

imread-0.7.4-cp38-cp38-manylinux2010_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

imread-0.7.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

imread-0.7.4-cp37-cp37m-manylinux2010_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

imread-0.7.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64

imread-0.7.4-cp36-cp36m-manylinux2010_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

imread-0.7.4-cp35-cp35m-manylinux2010_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.5mmanylinux: glibc 2.12+ x86-64

imread-0.7.4-cp27-cp27mu-manylinux2010_x86_64.whl (1.6 MB view details)

Uploaded CPython 2.7mumanylinux: glibc 2.12+ x86-64

imread-0.7.4-cp27-cp27m-manylinux2010_x86_64.whl (1.6 MB view details)

Uploaded CPython 2.7mmanylinux: glibc 2.12+ x86-64

File details

Details for the file imread-0.7.4.tar.gz.

File metadata

  • Download URL: imread-0.7.4.tar.gz
  • Upload date:
  • Size: 151.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

File hashes

Hashes for imread-0.7.4.tar.gz
Algorithm Hash digest
SHA256 0487adef11a22168700968c1727020361a72f6132b6ced2b8826b02d8cbf744f
MD5 6d881ee2ba221dab2bd46c4acfb9b40d
BLAKE2b-256 4af99aa28049f0e03786b59ba9a142fa7209701f291af1b7c02b8ab4bdf39122

See more details on using hashes here.

File details

Details for the file imread-0.7.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: imread-0.7.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.8.1 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for imread-0.7.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 49f363d25891726d3f01fadf3a693773e0f512631ad1e8616798bad807ff8b79
MD5 9ec0f89975c176faf688bfa11bf12580
BLAKE2b-256 7d7c222fba474c6f3704c73143ede21452f5ee5b8dead177656ee1fa8ddcbcfb

See more details on using hashes here.

File details

Details for the file imread-0.7.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: imread-0.7.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.8.1 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for imread-0.7.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9b7fc2af73380dd36b4dacb17a0b0a32d1b911e8c9d1c9d3de2abaf0e49ef52a
MD5 65b84cd490683cef5b0e6866dcf16f07
BLAKE2b-256 66c34cff91f6676d110f2743c9fab78a0ec16f5721750c4754c7f126e68eb179

See more details on using hashes here.

File details

Details for the file imread-0.7.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: imread-0.7.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.8.1 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for imread-0.7.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e5b198786f7fe65ca7cfb3e62dfd34741ece7872aa466fecdb79b20f82d828f2
MD5 f2c7d0efa24b45796d57d89eb361f673
BLAKE2b-256 a92f4ba990c571a2899ebc9bbdae0fa4d6741bebc7b88cdfe40eb4380b0bb8dc

See more details on using hashes here.

File details

Details for the file imread-0.7.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: imread-0.7.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.8.1 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for imread-0.7.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d9627c14e60591e13a178eaefdf1f0f591a660236b884627bcea197a167662d1
MD5 361df482400ac8dd4fdb83b65cd4e26d
BLAKE2b-256 93211d8e1bc9e2e61989389ad2453edb1627750b7055f0cc5577588148592427

See more details on using hashes here.

File details

Details for the file imread-0.7.4-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: imread-0.7.4-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

File hashes

Hashes for imread-0.7.4-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 ce6e163ce3e4215b8e06a6c6a406fca228637589bf3d782b10c3bd5e47fef7b9
MD5 0125b6154c4e6fa2c86cf6d59f24e776
BLAKE2b-256 7ffeada9c32ecb0b04b2f97f5f8903b3f0e54c943493a82ed398459ab3b54f61

See more details on using hashes here.

File details

Details for the file imread-0.7.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: imread-0.7.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.8.1 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for imread-0.7.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 74a60f570554411926faf45316c58c805ead90c50d783f5ac4313d06c5c0d323
MD5 ed3da049e740b3aaeff4f00d2f7e959d
BLAKE2b-256 0012693abf2d9e48c46682ec6bce9216d75dea3f80c32ac8095a7d632b2ce13c

See more details on using hashes here.

File details

Details for the file imread-0.7.4-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: imread-0.7.4-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

File hashes

Hashes for imread-0.7.4-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 14dac12d480b5033ed292e7034b5e7704194f58a2dd0442eed41bd4d5cf0e5de
MD5 8bf97ac498b56d9355841e2a841dec1f
BLAKE2b-256 8976cc2df0a2948ea12b3ce013267c4acbb9cc7cb6e4d9a54a2f3d16243d0b54

See more details on using hashes here.

File details

Details for the file imread-0.7.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: imread-0.7.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.8.1 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for imread-0.7.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 97366de465994b904ffb05b6989352cc8f9925ef0513977b7c789f65d56e5a82
MD5 65825ca59e8d0410693c5b550931735a
BLAKE2b-256 8cd75d0cc9607673d98767114ce8cfeef2414897da561e25b0fdf6da5fb9db19

See more details on using hashes here.

File details

Details for the file imread-0.7.4-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: imread-0.7.4-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

File hashes

Hashes for imread-0.7.4-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 41c0c2ddc292ab8578ebf8da6403d504de564b2a074bd4678e33e77112fcef86
MD5 9336f9860d29c5013f992b11cd4444a5
BLAKE2b-256 91486725bcdf0d8c7ad1204579d882ae3b74052d444e926eb804c61a665e148a

See more details on using hashes here.

File details

Details for the file imread-0.7.4-cp35-cp35m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: imread-0.7.4-cp35-cp35m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

File hashes

Hashes for imread-0.7.4-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 295e9ba36f6419c76225850a4cb73d60245c54870b4b0e12ff3255b86e3d5cd5
MD5 03821adac8365f41d48490e356be27d1
BLAKE2b-256 4813481050f06de1ae3ce63085a0074d5a47d0e1e12f9e6fd0eb2b45783e9768

See more details on using hashes here.

File details

Details for the file imread-0.7.4-cp27-cp27mu-manylinux2010_x86_64.whl.

File metadata

  • Download URL: imread-0.7.4-cp27-cp27mu-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 2.7mu, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

File hashes

Hashes for imread-0.7.4-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 a53746afbc522b49bd5a6e00f3ec4f4e3145f4e555d765de3283e917fa001bb2
MD5 a973ae241c3dcfa8a3bb2612ff2db946
BLAKE2b-256 cda0f7faa9e9b682103549346b3fdf330504f9c122bc86ce4d15d2a8341c6a9c

See more details on using hashes here.

File details

Details for the file imread-0.7.4-cp27-cp27m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: imread-0.7.4-cp27-cp27m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 2.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

File hashes

Hashes for imread-0.7.4-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d472c7c6410c34abffa15a647f75a3b9507aacee062ec2c586bdc63b53156870
MD5 3a8e601a40ac95cedba3bd2346c6e2a5
BLAKE2b-256 61035997926a43c42ef54ead9b62ad95416646b4f1cc59bc940f331d043b63fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page