<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>Problem with converting GeoTIFF to Numpy array (ValueError: unrecognised mode)</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hi<BR>
<BR>
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:<BR>
<BR>
<BR>
&gt;&gt;import Numpy<BR>
&gt;&gt;from PIL import Image<BR>
&gt;&gt;im = Image.open('dem.TIF')<BR>
&gt;&gt;print im.format, im.size, im.mode<BR>
&gt;&gt; TIFF (6000, 6000) I;16S<BR>
&gt;&gt;dem = fromstring(im.tostring(),'int16')<BR>
....<BR>
....<BR>
ValueError: unrecognised mode<BR>
<BR>
The problem must be because of mode of my data (I;16S) and I don't know how to read it.<BR>
I really appreciate any help with this.<BR>
<BR>
Many Thanks<BR>
Cheers,<BR>
<BR>
Hani</FONT>
</P>

</BODY>
</HTML>