I'm working on large satellite image files in the .tif format. To start, I am just trying to open the files and view them using PIL. Here is the code I have written so far:
from PIL import Image
import os.path
script_dir = os.path.dirname(os.path.abspath(__file__))
im = Image.open(os.path.join(script_dir, 'orthoQB02_11JUL040015472-M1BS-101001000DB70900_u16ns3413.tif'))
im.show()
Unfortunately, I am receiving the error message:
IOError Traceback (most recent call last)
/Applications/Canopy.app/appdata/canopy-1.3.0.1715.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
202 else:
203 filename = fname
----> 204 __builtin__.execfile(filename, *where)
/Users/zlazow/Desktop/Geo Research Files/documents-export-2014-02-13 (3)/showfiles.py in <module>()
3
4 script_dir = os.path.dirname(os.path.abspath(__file__))
----> 5 im = Image.open(os.path.join(script_dir, 'orthoQB02_11JUL040015472-M1BS-101001000DB70900_u16ns3413.tif'))
6 im.show()
/Users/zlazow/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/PIL/Image.pyc in open(fp, mode)
1978 pass
1979
----> 1980 raise IOError("cannot identify image file")
1981
1982 #
IOError: cannot identify image file
Are the image files simply too large for PIL? I can open one of the smaller (200MB) .tif files in the Preview Application, but when I try to open it using PIL it creates a BMP image that opens in Preview, but the image never loads.
All of the rest of the files (300MB++) will not open with Preview or PIL at all.
Thanks for any assistance.