Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiff: IOError: cannot identify 16-bit TIF file #2556

Closed
lackas opened this issue May 29, 2017 · 3 comments
Closed

Tiff: IOError: cannot identify 16-bit TIF file #2556

lackas opened this issue May 29, 2017 · 3 comments

Comments

@lackas
Copy link

lackas commented May 29, 2017

When trying to open a 16-bit DirectClass TIF file, Pillow fails with IOError: cannot identify image file 'rose16.tiff' error message.

Using ImageMagick's standard rose example an 8- vs 16-bit depth options one image loads, while the other fails. This is on a standard CentOS 6 with libtiff 3.9.4 (which is also used by IM, so it is not an issue of libtiff)

from PIL import Image

# # Use ImageMagick's convert tool to create example images with 8- and 16-bit color depth:
# convert rose: -depth 8  rose8.tiff
# convert rose: -depth 16 rose16.tiff

im8  = Image.open("rose8.tiff")
im16 = Image.open("rose16.tiff")

# IOError: cannot identify image file 'rose16.tiff'
@wiredfool
Copy link
Member

Can you post the image that fails?

@lackas
Copy link
Author

lackas commented May 29, 2017

Sure, here are the working and failing tif image, both created by ImageMagick:
rose.zip

$ identify rose16.tiff 
rose16.tiff TIFF 70x46 70x46+0+0 16-bit sRGB 19.6KB 0.000u 0:00.000

$ identify rose8.tiff 
rose8.tiff TIFF 70x46 70x46+0+0 8-bit sRGB 9.96KB 0.000u 0:00.000

@wiredfool
Copy link
Member

wiredfool commented May 29, 2017

The 16 bit image is an unsupported format. Pillow doesn't support multiband images with individual channels > 8 bit, and that is a 3 x 16 bit image.

(that's despite imagemagick calling it a Depth: 16/8-bit image)

There's an open issue for adding support: #1888

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants