2007.01.31 16:39 "[Tiff] 16bit grayscale with colormap", by Reinhard Mayr aka Czerwinski

2007.01.31 18:06 "Re: [Tiff] Interpreting SubIFDs tag", by Phil Harvey

I would like to hear an authoritative answer on this, but as far as I know, the IFD0->IFD1->IFDN chain is the only one which actually uses the next-IFD pointer to chain IFD's. It is common practice to put a zero next-IFD pointer at the end of other IFD's, but I've never seen this pointer used.

- Phil

On 31-Jan-07, at 12:05 PM, tiff-request@lists.maptools.org wrote:

> Message: 1
> Date: Wed, 31 Jan 2007 11:53:37 +0100
> From: mikk <mikk@go2.pl>
> Subject: [Tiff] Interpreting SubIFDs tag
> To: tiff@lists.maptools.org
> Message-ID: <45C07531.8080604@go2.pl>
> Content-Type: text/plain; charset=ISO-8859-2; format=flowed
>
> Hello all,
> I'm a bit confused with interpreting SubIFDs tag value.
>

> Each value of N values in SubIFDs tag is an offset (from the beginning > of the TIFF file, as always) to a child IFD. But is each value of N

> values an offset to a single child IFD, or to the first IFD from a > linked list of IFDs? When I read each of these N child IFDs, am I

> supposed to interpret NextIFDOffset field and read next directory from > this position for each of child IFDs?

>
> Could anyone put some light on this, please?
>
> Thanks in advance, kind regards,
>
> mikk
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 31 Jan 2007 17:39:04 +0100
> From: "Reinhard Mayr aka Czerwinski" <czerwinski1977@gmx.net>
> Subject: [Tiff] 16bit grayscale with colormap
> To: tiff@lists.maptools.org
> Message-ID: <20070131163904.36820@gmx.net>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello,
>

> I deal with 16bit grayscale TIFFs. The files originate from a 12bit > CCD, so the linear conversion 16bit->8bit turns my image almost black.

>

> To cope with that, I would like to add a ColorMap into the TIFF. > For testing, I altered an existing 16bit file:

> o photometrics = 3 (ColorMap)
> o added a colormap (tag 0140), length: 3*2^16= 196608 bytes
>

> Porgrams either refuse this file (ImageMagick viewer) or ignore the > colormap and treat as if without (ImageJ).

>

> Is this a proper interpretation of the TIFF specs (TIFF6 specs p.23 > allow only 4/8 bits per sample -- why?)? How can I work with the

> data in terms of leaving original values untouched and just change > a LUT/ColorMap/whatever?

>
> Thanks for all advices, hints & pointers!
>
> Cz.
> --
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 31 Jan 2007 14:56:52 -0200
> From: Toby Thain <toby@smartgames.ca>
> Subject: Re: [Tiff] 16bit grayscale with colormap
> To: "Reinhard Mayr aka Czerwinski" <czerwinski1977@gmx.net>
> Cc: tiff@lists.maptools.org

> Message-ID: <8D6BFBC5-5621-404D-9492-2D89DA20BB1F@smartgames.ca> > Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed

On 31-Jan-07, at 2:39 PM, Reinhard Mayr aka Czerwinski wrote:

I deal with 16bit grayscale TIFFs. The files originate from a 12bit CCD, so the linear conversion 16bit->8bit turns my image almost black.

Maybe I'm missing something, but why don't you just multiply by 16 before storing in TIFF?

--Toby

To cope with that, I would like to add a ColorMap into the TIFF. For testing, I altered an existing 16bit file:

  • photometrics = 3 (ColorMap)
  • added a colormap (tag 0140), length: 3*2^16= 196608 bytes

Porgrams either refuse this file (ImageMagick viewer) or ignore the colormap and treat as if without (ImageJ).

Is this a proper interpretation of the TIFF specs (TIFF6 specs p.23 allow only 4/8 bits per sample -- why?)? How can I work with the data in terms of leaving original values untouched and just change a LUT/ColorMap/whatever?

Thanks for all advices, hints & pointers!

Cz.

>> I