[Image-SIG] working with multi-spectral imagery, PIL, and NumPy

W. Bryan Smith wbsmith at gmail.com
Wed May 23 00:38:09 CEST 2007


hi nate,

i am wondering what you have tried with PIL and numpy.  there is a
tiff header that specifies samples per pixel, and PIL should be able
to get the data based on that.  so if you do:

import Image
img = Image.open('yourImage.tif')
img.tag.get(277)[0]

what does it return?  i have written some code that successfully puts
rgb tiff data into numpy arrays, but i don't have any means of trying
it with anything more than rgb data.  i am very new to python and even
newer to using PIL (as in, a couple days), but the code i have seems
to be working.

bryan


More information about the Image-SIG mailing list