Unused and no longer maintained
This Git repository contains a Python wrapper for the libtiff library.
It provides the following features:
- read and write TIFF images using the libtiff v4 reference implementation
- read and write scientific grade TIFF images
- support gray8, gray16, rgb8, rgb16 image formats
- interleaved and planar format for RGB composite format
- LZW compression
- Numpy array
The wrapper is generated by Swig and built using CMake.
The source code should be considered as a concrete example to read and write TIFF images using the libtiff, but not as a clean Python module. A nice enhancement would be to use CFFI instead of Swig and build using a standard setup.py. (I don't plan to do it soon.)
This Python module was written as an alternative to the unmaintained PIL library that provides a partial TIFF implementation written in Python. In opposite this implementation could gives access to the whole TIFF format.
The PyLibTiff project is hosted at github http://github.com/FabriceSalvaire/PyLibTiff
- libtiff (devel package)
- Python 2.7 (devel package)
- Numpy
- CMake
- Swig
- GCC
Run the following commands in a terminal:
git clone git@github.com:FabriceSalvaire/PyLibTiff.git mkdir PyLibTiff-build cd PyLibTiff-build ccmake PyLibTiff
This procedure was tested on Fedora 18 x64, take care to compile against Python 2.7 library and not Python 3.
See Python files in the examples directory.