PIL have only limited support for the "I;16" modules; try converting the image to mode "I" before you pass it on to NumPy.
</F> 2009/1/31 Hani Zahiri <h.zah...@curtin.edu.au>: > Hi > > I am trying to read a GeoTIFF and convert it to a Numpy array. Though, I am > able to open the image with no problem, however I am keep getting > 'ValueError: unrecognised mode' anytime I try to use any methods from PIL's > classes. My lines and results are like this: > > >>>import Numpy >>>from PIL import Image >>>im = Image.open('dem.TIF') >>>print im.format, im.size, im.mode >>> TIFF (6000, 6000) I;16S >>>dem = fromstring(im.tostring(),'int16') > .... > .... > ValueError: unrecognised mode > > The problem must be because of mode of my data (I;16S) and I don't know how > to read it. > I really appreciate any help with this. > > Many Thanks > Cheers, > > Hani > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://mail.python.org/mailman/listinfo/image-sig > > _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig