image icon indicating copy to clipboard operation
image copied to clipboard

Cannot open Tiff Black and white chanel

Open sophie-h opened this issue 11 months ago • 1 comments

Example image:

https://gitlab.gnome.org/-/project/27706/uploads/041c5adc3c3e723cd9bce2bee4c02917/202209020014164101_2R.tif

The encoder or decoder for Tiff does not support the color type `Unknown(1)`

Downstream issue https://gitlab.gnome.org/GNOME/glycin/-/issues/113

sophie-h avatar Jan 23 '25 23:01 sophie-h

There's some unreleased fixes for 1-bit TIFF files in https://github.com/image-rs/image-tiff/pull/252. However, at the moment the image crate bails regardless when it encounters one, because there isn't any logic yet to convert from 1-bit to 8-bits colors.

fintelia avatar Jan 24 '25 01:01 fintelia

I tried implementing 1 bps support in image crate but ultimately failed with this test file due to Fax4 compression method. Did some research on the issue and found prior work:

Unmerged PR for image-rs crate: https://github.com/image-rs/image/pull/2377/files

Unmerged PR for image-tiff crate: https://github.com/image-rs/image-tiff/pull/229

volodkuzn avatar Jun 29 '25 15:06 volodkuzn