Blame man/tiffcp.1

Packit 994f1a
.\" $Id: tiffcp.1,v 1.9.2.1 2010-06-04 16:51:14 fwarmerdam Exp $
Packit 994f1a
.\"
Packit 994f1a
.\" Copyright (c) 1988-1997 Sam Leffler
Packit 994f1a
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
Packit 994f1a
.\"
Packit 994f1a
.\" Permission to use, copy, modify, distribute, and sell this software and 
Packit 994f1a
.\" its documentation for any purpose is hereby granted without fee, provided
Packit 994f1a
.\" that (i) the above copyright notices and this permission notice appear in
Packit 994f1a
.\" all copies of the software and related documentation, and (ii) the names of
Packit 994f1a
.\" Sam Leffler and Silicon Graphics may not be used in any advertising or
Packit 994f1a
.\" publicity relating to the software without the specific, prior written
Packit 994f1a
.\" permission of Sam Leffler and Silicon Graphics.
Packit 994f1a
.\" 
Packit 994f1a
.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
Packit 994f1a
.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
Packit 994f1a
.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
Packit 994f1a
.\" 
Packit 994f1a
.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
Packit 994f1a
.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
Packit 994f1a
.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
Packit 994f1a
.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
Packit 994f1a
.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
Packit 994f1a
.\" OF THIS SOFTWARE.
Packit 994f1a
.\"
Packit 994f1a
.if n .po 0
Packit 994f1a
.TH TIFFCP 1 "February 24, 2007" "libtiff"
Packit 994f1a
.SH NAME
Packit 994f1a
tiffcp \- copy (and possibly convert) a
Packit 994f1a
.SM TIFF
Packit 994f1a
file
Packit 994f1a
.SH SYNOPSIS
Packit 994f1a
.B tiffcp
Packit 994f1a
[
Packit 994f1a
.I options
Packit 994f1a
]
Packit 994f1a
.I "src1.tif ... srcN.tif dst.tif"
Packit 994f1a
.SH DESCRIPTION
Packit 994f1a
.I tiffcp
Packit 994f1a
combines one or more files created according
Packit 994f1a
to the Tag Image File Format, Revision 6.0
Packit 994f1a
into a single
Packit 994f1a
.SM TIFF
Packit 994f1a
file.
Packit 994f1a
Because the output file may be compressed using a different
Packit 994f1a
algorithm than the input files,
Packit 994f1a
.I tiffcp
Packit 994f1a
is most often used to convert between different compression
Packit 994f1a
schemes.
Packit 994f1a
.PP
Packit 994f1a
By default, 
Packit 994f1a
.I tiffcp
Packit 994f1a
will copy all the understood tags in a
Packit 994f1a
.SM TIFF
Packit 994f1a
directory of an input
Packit 994f1a
file to the associated directory in the output file.
Packit 994f1a
.PP
Packit 994f1a
.I tiffcp
Packit 994f1a
can be used to reorganize the storage characteristics of data
Packit 994f1a
in a file, but it is explicitly intended to not alter or convert
Packit 994f1a
the image data content in any way.
Packit 994f1a
.SH OPTIONS
Packit 994f1a
.TP
Packit 994f1a
.BI \-b " image"
Packit 994f1a
subtract the following monochrome image from all others
Packit 994f1a
processed.  This can be used to remove a noise bias
Packit 994f1a
from a set of images.  This bias image is typically an
Packit 994f1a
image of noise the camera saw with its shutter closed.
Packit 994f1a
.TP
Packit 994f1a
.B \-B
Packit 994f1a
Force output to be written with Big-Endian byte order.
Packit 994f1a
This option only has an effect when the output file is created or
Packit 994f1a
overwritten and not when it is appended to.
Packit 994f1a
.TP
Packit 994f1a
.B \-C
Packit 994f1a
Suppress the use of ``strip chopping'' when reading images
Packit 994f1a
that have a single strip/tile of uncompressed data.
Packit 994f1a
.TP
Packit 994f1a
.B \-c
Packit 994f1a
Specify the compression to use for data written to the output file:
Packit 994f1a
.B none 
Packit 994f1a
for no compression,
Packit 994f1a
.B packbits
Packit 994f1a
for PackBits compression,
Packit 994f1a
.B lzw
Packit 994f1a
for Lempel-Ziv & Welch compression,
Packit 994f1a
.B jpeg
Packit 994f1a
for baseline JPEG compression,
Packit 994f1a
.B zip
Packit 994f1a
for Deflate compression,
Packit 994f1a
.B g3
Packit 994f1a
for CCITT Group 3 (T.4) compression,
Packit 994f1a
and
Packit 994f1a
.B g4
Packit 994f1a
for CCITT Group 4 (T.6) compression.
Packit 994f1a
By default
Packit 994f1a
.I tiffcp
Packit 994f1a
will compress data according to the value of the
Packit 994f1a
.I Compression
Packit 994f1a
tag found in the source file.
Packit 994f1a
.IP
Packit 994f1a
The
Packit 994f1a
.SM CCITT
Packit 994f1a
Group 3 and Group 4 compression algorithms can only
Packit 994f1a
be used with bilevel data.
Packit 994f1a
.IP
Packit 994f1a
Group 3 compression can be specified together with several
Packit 994f1a
T.4-specific options:
Packit 994f1a
.B 1d
Packit 994f1a
for 1-dimensional encoding,
Packit 994f1a
.B 2d
Packit 994f1a
for 2-dimensional encoding,
Packit 994f1a
and
Packit 994f1a
.B fill
Packit 994f1a
to force each encoded scanline to be zero-filled so that the
Packit 994f1a
terminating EOL code lies on a byte boundary.
Packit 994f1a
Group 3-specific options are specified by appending a ``:''-separated
Packit 994f1a
list to the ``g3'' option; e.g.
Packit 994f1a
.B "\-c g3:2d:fill"
Packit 994f1a
to get 2D-encoded data with byte-aligned EOL codes.
Packit 994f1a
.IP
Packit 994f1a
.SM LZW
Packit 994f1a
compression can be specified together with a 
Packit 994f1a
.I predictor
Packit 994f1a
value.
Packit 994f1a
A predictor value of 2 causes
Packit 994f1a
each scanline of the output image to undergo horizontal
Packit 994f1a
differencing before it is encoded; a value
Packit 994f1a
of 1 forces each scanline to be encoded without differencing.
Packit 994f1a
LZW-specific options are specified by appending a ``:''-separated
Packit 994f1a
list to the ``lzw'' option; e.g.
Packit 994f1a
.B "\-c lzw:2"
Packit 994f1a
for
Packit 994f1a
.SM LZW
Packit 994f1a
compression with horizontal differencing.
Packit 994f1a
.TP
Packit 994f1a
.B \-f
Packit 994f1a
Specify the bit fill order to use in writing output data.
Packit 994f1a
By default,
Packit 994f1a
.I tiffcp
Packit 994f1a
will create a new file with the same fill order as the original.
Packit 994f1a
Specifying
Packit 994f1a
.B "\-f lsb2msb"
Packit 994f1a
will force data to be written with the FillOrder tag set to
Packit 994f1a
.SM LSB2MSB,
Packit 994f1a
while
Packit 994f1a
.B "\-f msb2lsb"
Packit 994f1a
will force data to be written with the FillOrder tag set to
Packit 994f1a
.SM MSB2LSB.
Packit 994f1a
.TP
Packit 994f1a
.B \-i
Packit 994f1a
Ignore non-fatal read errors and continue processing of the input file.
Packit 994f1a
.TP
Packit 994f1a
.B \-l
Packit 994f1a
Specify the length of a tile (in pixels).
Packit 994f1a
.I tiffcp
Packit 994f1a
attempts to set the tile dimensions so
Packit 994f1a
that no more than 8 kilobytes of data appear in a tile.
Packit 994f1a
.TP
Packit 994f1a
.B \-L
Packit 994f1a
Force output to be written with Little-Endian byte order.
Packit 994f1a
This option only has an effect when the output file is created or
Packit 994f1a
overwritten and not when it is appended to.
Packit 994f1a
.TP
Packit 994f1a
.B \-M
Packit 994f1a
Suppress the use of memory-mapped files when reading images.
Packit 994f1a
.TP
Packit 994f1a
.B \-p
Packit 994f1a
Specify the planar configuration to use in writing image data
Packit 994f1a
that has one 8-bit sample per pixel.
Packit 994f1a
By default,
Packit 994f1a
.I tiffcp
Packit 994f1a
will create a new file with the same planar configuration as
Packit 994f1a
the original.
Packit 994f1a
Specifying
Packit 994f1a
.B "\-p contig"
Packit 994f1a
will force data to be written with multi-sample data packed
Packit 994f1a
together, while
Packit 994f1a
.B "\-p separate"
Packit 994f1a
will force samples to be written in separate planes.
Packit 994f1a
.TP
Packit 994f1a
.B \-r
Packit 994f1a
Specify the number of rows (scanlines) in each strip of data
Packit 994f1a
written to the output file.
Packit 994f1a
By default (or when value
Packit 994f1a
.B 0
Packit 994f1a
is specified),
Packit 994f1a
.I tiffcp
Packit 994f1a
attempts to set the rows/strip
Packit 994f1a
that no more than 8 kilobytes of data appear in a strip. If you specify
Packit 994f1a
special value
Packit 994f1a
.B \-1
Packit 994f1a
it will results in infinite number of the rows per strip. The entire image
Packit 994f1a
will be the one strip in that case.
Packit 994f1a
.TP
Packit 994f1a
.B \-s
Packit 994f1a
Force the output file to be written with data organized in strips
Packit 994f1a
(rather than tiles).
Packit 994f1a
.TP
Packit 994f1a
.B \-t
Packit 994f1a
Force the output file to be written with data organized in tiles (rather than
Packit 994f1a
strips). options can be used to force the resultant image to be written as
Packit 994f1a
strips or tiles of data, respectively.
Packit 994f1a
.TP
Packit 994f1a
.B \-w
Packit 994f1a
Specify the width of a tile (in pixels).
Packit 994f1a
.I tiffcp
Packit 994f1a
attempts to set the tile dimensions so that no more than 8 kilobytes of data
Packit 994f1a
appear in a tile.
Packit 994f1a
.I tiffcp
Packit 994f1a
attempts to set the tile dimensions so that no more than 8 kilobytes of data
Packit 994f1a
appear in a tile.
Packit 994f1a
.TP
Packit 994f1a
.B \-x
Packit 994f1a
Force the output file to be written with PAGENUMBER value in sequence.
Packit 994f1a
.TP
Packit 994f1a
.BI \-,= character
Packit 994f1a
substitute
Packit 994f1a
.I character
Packit 994f1a
for `,' in parsing image directory indices
Packit 994f1a
in files.  This is necessary if filenames contain commas.
Packit 994f1a
Note that
Packit 994f1a
.B \-,=
Packit 994f1a
with whitespace immediately following will disable
Packit 994f1a
the special meaning of the `,' entirely.  See examples.
Packit 994f1a
.SH EXAMPLES
Packit 994f1a
The following concatenates two files and writes the result using 
Packit 994f1a
.SM LZW
Packit 994f1a
encoding:
Packit 994f1a
.RS
Packit 994f1a
.nf
Packit 994f1a
tiffcp \-c lzw a.tif b.tif result.tif
Packit 994f1a
.fi
Packit 994f1a
.RE
Packit 994f1a
.PP
Packit 994f1a
To convert a G3 1d-encoded 
Packit 994f1a
.SM TIFF
Packit 994f1a
to a single strip of G4-encoded data the following might be used:
Packit 994f1a
.RS
Packit 994f1a
.nf
Packit 994f1a
tiffcp \-c g4 \-r 10000 g3.tif g4.tif
Packit 994f1a
.fi
Packit 994f1a
.RE
Packit 994f1a
(1000 is just a number that is larger than the number of rows in
Packit 994f1a
the source file.)
Packit 994f1a
Packit 994f1a
To extract a selected set of images from a multi-image TIFF file, the file
Packit 994f1a
name may be immediately followed by a `,' separated list of image directory
Packit 994f1a
indices.  The first image is always in directory 0.  Thus, to copy the 1st and
Packit 994f1a
3rd images of image file ``album.tif'' to ``result.tif'':
Packit 994f1a
.RS
Packit 994f1a
.nf
Packit 994f1a
tiffcp album.tif,0,2 result.tif
Packit 994f1a
.fi
Packit 994f1a
.RE
Packit 994f1a
Packit 994f1a
A trailing comma denotes remaining images in sequence.  The following command
Packit 994f1a
will copy all image with except the first one:
Packit 994f1a
.RS
Packit 994f1a
.nf
Packit 994f1a
tiffcp album.tif,1, result.tif
Packit 994f1a
.fi
Packit 994f1a
.RE
Packit 994f1a
Packit 994f1a
Given file ``CCD.tif'' whose first image is a noise bias
Packit 994f1a
followed by images which include that bias,
Packit 994f1a
subtract the noise from all those images following it
Packit 994f1a
(while decompressing) with the command:
Packit 994f1a
.RS
Packit 994f1a
.nf
Packit 994f1a
tiffcp \-c none \-b CCD.tif CCD.tif,1, result.tif
Packit 994f1a
.fi
Packit 994f1a
.RE
Packit 994f1a
Packit 994f1a
If the file above were named ``CCD,X.tif'', the
Packit 994f1a
.B \-,=
Packit 994f1a
option would
Packit 994f1a
be required to correctly parse this filename with image numbers,
Packit 994f1a
as follows:
Packit 994f1a
.RS
Packit 994f1a
.nf
Packit 994f1a
tiffcp \-c none \-,=% \-b CCD,X.tif CCD,X%1%.tif result.tif
Packit 994f1a
.SH "SEE ALSO"
Packit 994f1a
.BR pal2rgb (1),
Packit 994f1a
.BR tiffinfo (1),
Packit 994f1a
.BR tiffcmp (1),
Packit 994f1a
.BR tiffmedian (1),
Packit 994f1a
.BR tiffsplit (1),
Packit 994f1a
.BR libtiff (3TIFF)
Packit 994f1a
.PP
Packit 994f1a
Libtiff library home page:
Packit 994f1a
.BR http://www.remotesensing.org/libtiff/