Skip to main content

imread: Image reading library

Project description

[![Travis](https://api.travis-ci.org/luispedro/imread.png)](https://travis-ci.org/luispedro/imread) [![License](https://pypip.in/license/imread/badge.png)](http://opensource.org/licenses/MIT)

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

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 on nix, just use:

nix-env -iA nixpkgs.python27Packages.imread

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

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

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.6.tar.gz (116.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.6-cp36-cp36m-manylinux1_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.6m

imread-0.6-cp36-cp36m-manylinux1_i686.whl (3.1 MB view details)

Uploaded CPython 3.6m

imread-0.6-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.6mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

imread-0.6-cp35-cp35m-manylinux1_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.5m

imread-0.6-cp35-cp35m-manylinux1_i686.whl (3.1 MB view details)

Uploaded CPython 3.5m

imread-0.6-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.5mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

imread-0.6-cp34-cp34m-manylinux1_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.4m

imread-0.6-cp34-cp34m-manylinux1_i686.whl (3.1 MB view details)

Uploaded CPython 3.4m

imread-0.6-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.4mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

imread-0.6-cp27-cp27mu-manylinux1_x86_64.whl (3.2 MB view details)

Uploaded CPython 2.7mu

imread-0.6-cp27-cp27mu-manylinux1_i686.whl (3.1 MB view details)

Uploaded CPython 2.7mu

imread-0.6-cp27-cp27m-manylinux1_x86_64.whl (3.2 MB view details)

Uploaded CPython 2.7m

imread-0.6-cp27-cp27m-manylinux1_i686.whl (3.1 MB view details)

Uploaded CPython 2.7m

imread-0.6-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.6 MB view details)

Uploaded CPython 2.7mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: imread-0.6.tar.gz
  • Upload date:
  • Size: 116.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for imread-0.6.tar.gz
Algorithm Hash digest
SHA256 97364c44b9861ebd74dbf9a7cafea604a802543b3a9b463c9de68befed72d86c
MD5 b35abb1acaf550cff71e3d3cd2f293f2
BLAKE2b-256 7ac8ab440ea4b304b9f9371f5329c4209b049432f667a5085a6b6f1ab2ebcdd3

See more details on using hashes here.

File details

Details for the file imread-0.6-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for imread-0.6-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d8dbf49ac58d9d576fc7f97de62500b191511de9d2322053151aec05a802f62c
MD5 2bef76d5472247812097a37da3170a06
BLAKE2b-256 8eee0c0a9bbca6dbe8edc7e948c2038debbdbf9c5d86412e6bcce9ac697b9327

See more details on using hashes here.

File details

Details for the file imread-0.6-cp36-cp36m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for imread-0.6-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 ecaeda975b8ae3b5c2eef54dd8e69c953e98a4ed872aaaa40e7f6e30772769b2
MD5 9151caa027301a66bd55302df9c25825
BLAKE2b-256 7d2463e3e8cbb08a199d593c3ab35c8cd260b6b1f4abdabc37b643f026531e2b

See more details on using hashes here.

File details

Details for the file imread-0.6-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for imread-0.6-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 efed8d49bc700e9a7d97012658f6b80d97dd24fc9446fccc860648c98ea6c7d4
MD5 e6259baf3b0aa0a2570084389cf37d33
BLAKE2b-256 9ba887f292a76bfd3e6999e7fa54f7ea552b0b60082fd1ffacc75d10004ac056

See more details on using hashes here.

File details

Details for the file imread-0.6-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for imread-0.6-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b9d64c03ae1eb847a4c518c35713eac3bbe1ae6987ddd0041a01245e3572aa2c
MD5 8408c437fcd95694bde6491e4b8e746b
BLAKE2b-256 b1d1788e84694e92add15a8fe7c1ed0861d3a378605c9fa0e41df2d04be9a278

See more details on using hashes here.

File details

Details for the file imread-0.6-cp35-cp35m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for imread-0.6-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 7df2970707b218614b56f9eabec7c4a326cb51732393f7a99ef1b0790801385e
MD5 391601992e8f95791a1f15a04925263f
BLAKE2b-256 32bd742845e6d55809e56fa7c518d3033b29210d17926e76b8b69a662004bbb2

See more details on using hashes here.

File details

Details for the file imread-0.6-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for imread-0.6-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 381b45047828941afed2e9f88343d55d1686d7505fd5ae039b55acdc7d8e5f90
MD5 93ef13415bae976c4c872988e6911bf5
BLAKE2b-256 37f539d44c27556b0bc945aa35a07a302e102fe2fb4da938de102c2635deb76b

See more details on using hashes here.

File details

Details for the file imread-0.6-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for imread-0.6-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0823c60075dc5dc9c252121f53a5c1fad311c343bb5745d9b5a60e35254681db
MD5 ef011ff91ee20305df045bce03fa537e
BLAKE2b-256 0ef8cb38c9d680343079fdfc03a9eb755d46d3418588ab5d066a44f29c9deff6

See more details on using hashes here.

File details

Details for the file imread-0.6-cp34-cp34m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for imread-0.6-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 4ccea357aeca14e4deb6dd42195dd6feb78f99a6ba2f049ab828359da1aff267
MD5 7c06bc1d8e37995eeabac848175961b1
BLAKE2b-256 3a64158e7c63b4fd1c8cf5f3da9fa86d75fe5db33aae72cb91b5e0a46ee6b884

See more details on using hashes here.

File details

Details for the file imread-0.6-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for imread-0.6-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 fb6d4283bb6fa3670546ef18140bbcc09483bc95d379348fd18067e6ed037b50
MD5 ab4e57a1d7de474f8d25e44ab81943a7
BLAKE2b-256 e13e6cc519d33796c57178089551b29d74a2c339b7bbb57d84d82d3ddaf4aac8

See more details on using hashes here.

File details

Details for the file imread-0.6-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for imread-0.6-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 55861f0077c99d17294c8a01e3eb97a0ec7fd5ab5774ff611c718e08910a0d26
MD5 b08303ea2d688118647cfdee449e5e0c
BLAKE2b-256 724c483a395bdec51b010db320e227947b9e62efb9d204485dad77bb9777a54f

See more details on using hashes here.

File details

Details for the file imread-0.6-cp27-cp27mu-manylinux1_i686.whl.

File metadata

File hashes

Hashes for imread-0.6-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 d65080945cf545ea908ad0e079e834c1980951ed3eb9650bb7fb54ce921bed3f
MD5 88267d44dc0b744d7cfcd346cd341efb
BLAKE2b-256 7e6bde909133ccd5e5c05de0a613fe1df18b43aca446828d6c5c7a9521cdd890

See more details on using hashes here.

File details

Details for the file imread-0.6-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for imread-0.6-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7671b9067eb0620cbdf3ca1ea9021f886b0abe39556d07888dc74947480276a4
MD5 1ffbf0e0ed7bf6874bf0e1bb00f58a12
BLAKE2b-256 304ab61e31c308b77924e11ab031e1f274c42b42a401b6a1de48f4885a5801b5

See more details on using hashes here.

File details

Details for the file imread-0.6-cp27-cp27m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for imread-0.6-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 0008d5478c3bbf545d99e571efc3ed165435b49c8287c1aaa9beffd80439afdf
MD5 76bdd2b3f8ce181c1c122ed6e9c3347b
BLAKE2b-256 b5faa2ba48d9993888b61fee83109be5d5666cb47fc7b1ae4bf0469ddf230d3f

See more details on using hashes here.

File details

Details for the file imread-0.6-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for imread-0.6-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 a12a6d891b7afdd6009ceeaa2d2afc3b7614ca393abb76ac8a3234dbd8cfa960
MD5 d2fb0012bcfa472b75f06ec14a3f0fc7
BLAKE2b-256 6ddfc0c97303aa84cbebf4d4df8e16a196a16a4336d02086c0913fb0f165b1ff

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