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 files with unassociated extra samples are unsupported. #183

Open
Aerocatia opened this issue Oct 19, 2022 · 2 comments
Open

TIFF files with unassociated extra samples are unsupported. #183

Aerocatia opened this issue Oct 19, 2022 · 2 comments

Comments

@Aerocatia
Copy link

TIFF files with 2 samples per pixel (Luminance + Alpha) are unsupported by this library.
Such TIFF files are the default output of imagemagick if the input is grayscale.

Attached is an example.
example_tiff.zip

@fintelia
Copy link
Contributor

Do you know where specifically the error is coming from? GrayA is listed as a supported color type and I believe that most of the code doesn't care how many samples per pixel there are.

@HeroicKatora
Copy link
Member

HeroicKatora commented Oct 20, 2022

It seems, imagemagick does not encode it as a truly alpha component but as a mask:

$ tiffinfo *
TIFF Directory at offset 0x80008 (524296)
  Image Width: 512 Image Length: 512
  Resolution: 1, 1 (unitless)
  Bits/Sample: 8
  Compression Scheme: None
  Photometric Interpretation: min-is-black
  Extra Samples: 1<unassoc-alpha>
  FillOrder: msb-to-lsb
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 2
  Rows/Strip: 512
  Planar Configuration: single image plane
  Page Number: 0-1
  White Point: 0.3127-0.329
  PrimaryChromaticities: 0.640000,0.330000,0.300000,0.600000,0.150000,0.060000

This is probably intended in this case (pistol_scope_mask.tif) but quite possibly the reason that it's not commonly encountered or reported as such.

The library doesn't guess the meaning of extra channels and unassociated extra samples aren't supported.

@HeroicKatora HeroicKatora changed the title TIFF files with 2 samples per pixel are unsupported. TIFF files with unassociated extra samples are unsupported. Nov 2, 2022
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

3 participants