Python的TIFF库 PyLibTiff

fmms 13年前

PyLibTIff 是 Python 用来处理 TIFF 图像的开发包,示例代码:

>>> from libtiff import TIFF  >>> # to open a tiff file for reading:  >>> tif = TIFF.open('filename.tif', mode='r')  >>> # to read an image in the currect TIFF directory and return it as numpy array:  >>> image = tif.read_image()  >>> # to read all images in a TIFF file:  >>> for image in tif.iter_images(): # do stuff with image  >>> # to open a tiff file for writing:  >>> tif = TIFF.open('filename.tif', mode='w')  >>> # to write a image to tiff file  >>> tif.write_image(image)

项目主页:http://www.open-open.com/lib/view/home/1329487909765