AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
October 2005

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2005.10.08 15:55 "Monochrome tiff to monochrome bitmap", by Frank Mayer
2005.10.08 17:27 "Re: Monochrome tiff to monochrome bitmap", by Joris Van Damme

2005.10.08 17:27 "Re: Monochrome tiff to monochrome bitmap", by Joris Van Damme

Frank,

Frank Mayer wrote:
> Loading a monochrome tiff, it of course loads into the RGBA bitmap
> (using TIFFReadRGBAImage), thus using a lot more memory than
> necessary.
>
> I would like to be able to specify my bitmap as monochrome and use
> pf1bit to load the monochrome tiff bitmap into it, so that I can
> keep the footprint of the program as little as possible,
>
> But I have not found a way to read Monochrome tiff into monochrome
> bitmap. Am I missing something? Anyone has done this before?

You first need to see what color space and such is involved, unless by
application logic you already know for sure that it's 1bit per pixel
black and white.

Next, you need to detect whether strips or tiles are involved, and all
such (on multi-channel colorspace, there is also the issue of
planarconfiguration, subsampling, etc).

Next, depending on the outcome of the above, you can use the strip/tile
access level of LibTiff. This yields exactly what is in the TIFF, i.e.
for example 1 bit per pixel black and white, without converting to 32bit
per pixel RGBA.

For the color space and storage detection, there's a number of tags you
need to query. See
http://www.remotesensing.org/libtiff/man/TIFFGetField.3tiff.html for a
description of TIFFGetField, and
http://www.awaresystems.be/imaging/tiff/tifftags.html for information on
tags such as ImageWidth, ImageLength, BitsPerPixel,
PhotometricInterpretation, PlanarConfiguration, etc.

For the strip/tile access level in LibTiff, see
http://www.remotesensing.org/libtiff/libtiff.html for a very good
introduction. And of course, bookmark the LibTiff man index page
http://www.remotesensing.org/libtiff/man/index.html.



Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html