Blame man/tiffcp.1

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