Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython

imread is unavailable in PyPM, because there aren't any builds for it in the package repositories. Click the linked icons to find out why.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.3.1Never BuiltWhy not?
0.2.1 Failed View build log
0.1 Failed View build log
Windows (64-bit)
0.3.1Never BuiltWhy not?
0.2.1 Failed View build log
0.1 Failed View build log
Mac OS X (10.5+)
0.3.1Never BuiltWhy not?
0.2.1 Failed View build log
0.1 Failed View build log
Linux (32-bit)
0.3.1Never BuiltWhy not?
0.2.4 Failed View build log
0.2.3 Failed View build log
0.2.1 Failed View build log
0.1 Failed View build log
Linux (64-bit)
0.3.1 Failed View build log
0.2.4 Failed View build log
0.2.3 Failed View build log
0.2.1 Failed View build log
0.1 Failed View build log
0.3.1 Failed View build log
 
Links
License
MIT
Lastest release
version 0.3.1 on Sep 20th, 2013

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}
}
Dependencies

To install on debian/ubuntu:

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

To install on Mac:

sudo port install libpng tiff webp
Bug Reports

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

If you are not sure of whether this is the correct behaviour, you can discuss this on the pythonvision mailing list

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

Travis Build Status
https://travis-ci.org/luispedro/imread.png

Python versions 2.6, 2.7 and 3.3 are officially supported.

Python 3.4 should also work (submit a bug report if it does not). Python 3.2 (and earlier versions in the Python 3 series) are officially not supported.

History

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)

System Message: WARNING/2 (<string>, line 131)

Title underline too short.

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

Subscribe to package updates

Last updated Sep 20th, 2013

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.