1

I'm new to Python and trying to work with TIFF images using the following code:

from PIL import Image
import numpy 

im = Image.open('LakeEx.tif') 
imarray = numpy.array(im) 
imarray.shape 
im.show()

and I got this error:

"ValueError: tile cannot extend outside image"

Is there any specific criteria to the TIFF file to work with Python: size, bit,... etc?

1

The problem is that PIL wants to see a ".tiff" at the end of the file name. You have ".tif". The solution is to rename your file to "LakeEx.tiff".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.