Skip to main content

imread: Image reading library

Project description

https://api.travis-ci.org/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.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.1.tar.gz (147.2 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.1-cp37-cp37m-manylinux2010_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

imread-0.7.1-cp36-cp36m-manylinux2010_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

imread-0.7.1-cp35-cp35m-manylinux2010_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.5mmanylinux: glibc 2.12+ x86-64

imread-0.7.1-cp34-cp34m-manylinux2010_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.4mmanylinux: glibc 2.12+ x86-64

imread-0.7.1-cp27-cp27mu-manylinux2010_x86_64.whl (1.5 MB view details)

Uploaded CPython 2.7mumanylinux: glibc 2.12+ x86-64

imread-0.7.1-cp27-cp27m-manylinux2010_x86_64.whl (1.5 MB view details)

Uploaded CPython 2.7mmanylinux: glibc 2.12+ x86-64

File details

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

File metadata

  • Download URL: imread-0.7.1.tar.gz
  • Upload date:
  • Size: 147.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.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.1.tar.gz
Algorithm Hash digest
SHA256 c343b546ab54acdb50dbe69d6793d64ead3ba6d585022f5a7ad4687b7f3db79b
MD5 48f4c71f58ff1c5c3bce5939f4d409dc
BLAKE2b-256 4e7e52603151a6746a229f80b3d22a08e468dce9bcf723728a3b99d050372e86

See more details on using hashes here.

File details

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

File metadata

  • Download URL: imread-0.7.1-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.5 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.19.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.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 871d2b91c0b76df25fb88dc741f0489280fbe36b13feb0500015b67174c7ae05
MD5 c0d735f84729e6dcb255ff447b247948
BLAKE2b-256 a45f6d57235a6064c303bdf94356216e5360835ea3de97a8bbda84d90b06d7cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: imread-0.7.1-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.5 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.19.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.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 1ca20a4319ea7b04410bb7253e9ab2f66058c9ab2409bc22aad90930790229e7
MD5 43ae66cc74e9b8d998c007676e75b8d9
BLAKE2b-256 024c6d3a661e2129a5847dd4c2ef9a19fd1791b5b16ab808b7cb6edc1fdd9b33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: imread-0.7.1-cp35-cp35m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.5 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.19.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.1-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 a5d9f486726d6526b9528f33aab9650522e8adbbfe6ccc15293b96548b0e46c8
MD5 1e727bd01f6d9e4c499d435afd9d572d
BLAKE2b-256 e74d68e83bd55c5c7b26f2f34d1c90881bdef116d7f460af8b989767ce82c671

See more details on using hashes here.

File details

Details for the file imread-0.7.1-cp34-cp34m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: imread-0.7.1-cp34-cp34m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.4m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.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.1-cp34-cp34m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 c1309433669a3cccebf146500a7fceccfc032a7e431dba7d0cb431e736e7c58c
MD5 6112a3f000a5505004b37dd0451f557f
BLAKE2b-256 0edd89f1660874b8365e11f81d65d4cab0d8bb12f40d1370a139932cdf7cb248

See more details on using hashes here.

File details

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

File metadata

  • Download URL: imread-0.7.1-cp27-cp27mu-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.5 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.19.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.1-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 958f7b063290096cbd4f3d662ebc1f2aad091d9ee899c3d83eb61f979ddd5beb
MD5 cd9d4cdfcd194ce64972366267bbab37
BLAKE2b-256 c0faf1cc1795e5f194c0d65961615e580dcb3f72e5f7d844c435250356a95530

See more details on using hashes here.

File details

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

File metadata

  • Download URL: imread-0.7.1-cp27-cp27m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.5 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.19.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.1-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 f06a31c2fe365dbefb2415e24399c3ab2f3cb59224eb923c94d827b84c59e9cb
MD5 e6bafbf4f1404ea340ff87442ce346d5
BLAKE2b-256 6dc17ea81da83466c269c3a06e5d5544c0d9380d188dcf778c69bf06e87c094b

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