Blame man/tiffcp.1

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