2013.10.28 07:43 "[Tiff] Does TIFF support 15-bit (RGB555 or 5551) images?", by Nikos Chantziaras

2013.10.28 09:38 "Re: [Tiff] Does TIFF support 15-bit (RGB555 or 5551) images?", by Joris Van Damme

Nikos,

2013/10/28 Nikos Chantziaras <realnc@gmail.com>:

I've been trying a lot of experiments, but can't seem to be able to create a TIFF image file with 15-bit or 16-bit pixels. By that I mean formats like 5-5-5, 5-5-5-1 or 5-6-6. The parameters I'm trying are:

   SAMPLESPERPIXEL: 3 (and 4, hoping for 5-5-5-1)
   BITSPERSAMPLE: 5
   PHOTOMETRIC: RGB
   PLANARCONFIG: CONTIG

It just doesn't work. The created files seem to have a bit depth of 4 per channel (as reported by ImageMagick) and they display either garbled or in grayscale, depending on the viewer.

TIFF supports 5-5-5. Meaning, there are 15 bits per pixel, so pixels are not byte-bound. It also supports 5-5-5-1, except that you can't flag the 1-bit channel as padding. You can, however, mark it as an undefined extra sample, and that should amount to more or less the same thing, as properly implemented decoders should ignore undefined extra samples.

LibTiff does not support differerent BitsPerSample values for different channels. So it cannot not support 5-5-5-1, even though TIFF can. But LibTiff should be OK with 5-5-5.

Of course, ImageMagick support may be more limited.

Best regards,

Joris Van Damme

AWare Systems
info@awaresystems.be
http://www.awaresystems.be/