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
December 2008

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

2008.12.15 08:32 "Re: Layers and multipage", by <shailaj@mail.com.np>
2008.12.15 18:30 "Re: Layers and multipage", by Bob Friesenhahn
2008.12.16 04:26 "Re: Layers and multipage", by <shailaj@mail.com.np>
2008.12.16 04:34 "Re: Layers and multipage", by Bob Friesenhahn
2008.12.16 17:04 "Extracting layers from a TIFF file", by Richard Nolde
2008.12.17 12:34 "Re: Extracting layers from a TIFF file", by <shailaj@mail.com.np>
2008.12.17 15:40 "Re: Extracting layers from a TIFF file", by Toby Thain
2008.12.17 15:54 "Re: Extracting layers from a TIFF file", by Gerben Vos
2008.12.17 16:22 "Re: Extracting layers from a TIFF file", by Toby Thain
2008.12.17 19:02 "Re: Extracting layers from a TIFF file", by Igor Skochinsky
2008.12.17 19:41 "Re: Extracting layers from a TIFF file", by Chris Cox
2008.12.15 18:58 "Re: Layers and multipage", by Toby Thain
2008.12.15 19:23 "Re: Layers and multipage", by Chris Cox
2008.12.16 14:31 "Re: Layers and multipage", by Toby Thain

2008.12.16 17:04 "Extracting layers from a TIFF file", by Richard Nolde

On Tue, 16 Dec 2008, Mitesh wrote

> > Now it is clear to me that multi pages and layers are two different beasts.
> >
> > Now I need to extract layers from a Tiff file. How should I do it? Please
> > suggest.
> Do you know how many layers are in your TIFF file?  If you install 
> libtiff and utilities, what is the output of 'tiffinfo' when provided 
> the name of your file?
>
> My software (GraphicsMagick) may be useful but it only handles up to 
> four channels ("layers"), one of which must be an alpha channel. 
> There is likely other software much better at handling TIFFs with an 
> arbitrary number of channels.
>
> Bob
> ======================================
> Bob Friesenhahn
The next version of tiffcrop has hooks that could be used to do this and 
it is not limited to 4 channels. I posted a query to the list as to 
whether this would be useful and no one replied so I only implemented it 
for debugging purposes.  What exactly do you mean when you say extract a 
layer?  Extract the raw binary data as a data dump in binary or ASCII 
format or to a new TIFF file.  The first case can be handled with my 
debugging dump code.  The later requires some information about how 
various types of TIFF input files will be converted to output files.  eg 
RGBA to RGB may not be a big deal since you are just throwing away the 
alpha channel but all current planes would have to be multiplied by the 
values in the alpha channel if is is associated alpha data if I remember 
correctly.  However extracting one or more input channels  
RGB[A][N1][N2]...  to one of R,G,B,A,N1,N2  requires some interpretation 
of the input data and a new definition of the output file type.  Does a 
single channel become a 'grayscale' image and if so, what about bit 
depth conversions?  If you extract any three channels from a 
multi-spectral image, does it become RGB?  Since I doubt that there is 
any legal TIFF image type where the number of image planes is not 1,3,4 
or greater than four. You probably cannot extract only two channels to a 
new TIFF image. 

If you can define the conversions in a way that are generally accepted 
by the other members of the TIFF community, I could probably add that 
support to tiffcrop in the next release after this one.  The current 
version in CVS will be obsoleted by the version that is soon to be 
uploaded so don't bother looking at it as it has none of the code you need.

Richard Nolde
Tiffcrop author