Boost logo

Boost Users :

Subject: [Boost-users] [Gil] TIFF file with mixed 8/16 bit channel depths
From: Corinna Kinchin (crin_at_[hidden])
Date: 2011-11-03 10:53:53


Hello,

I'm using

        boost::gil::read_image(in, img, tiff_tag());

as part of a process to extract raw image data from a TIFF file,
and it works beautifully for cmyka TIFF files containing either
5 x 8-bit channels, or 5 x 16-bit channels. But it seems using
this technique mangles image data contained in a (photoshop
generated) TIFF file which contains CMYK channels with both 8
and 16 bit depths (mixed).

Here is an extract from the ImageMagick 'identify -verbose'
output on such a file:

 Depth: 8/16-bit

 Channel depth:
  cyan: 16-bit
  magenta: 16-bit
  yellow: 16-bit
  black: 8-bit
  alpha: 8-bit

It seems that read_image treats the TIFF file as if it contains
5 x 8-bit channels (the TIFFTAG_BITSPERSAMPLE property and
hence the _bits_per_sample info value for the TIFF file is set to 8),
so the CMY channel image data isn't read in correctly ... at least
that's my best guess.

Does anyone out there know whether boost::gil can be made to support
8/16bit TIFF files - eg if there's an extension (or hack ;) which
could do the trick? Or any other options (eg other libraries) which
could be worth investigation?

Many thanks for reading this far, and if you have any remotely relevent
ideas it would be great to hear them ...

All the best,

Corinna ...

 Corinna Kinchin email: ckinchin_at_[hidden]
 Datazone Ltd. Tel: +353 64 66 28964
 Palm Gate, Greenane, Fax: +353 64 66 28965
 Killarney, Co. Kerry, Ireland URL: http://www.miramo.com

 Datazone - makers of `Miramo', the automated publishing tool


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net