1TIFFCP(1) General Commands Manual TIFFCP(1)
2
3
4
6 tiffcp - copy (and possibly convert) a TIFF file
7
9 tiffcp [ options ] src1.tif ... srcN.tif dst.tif
10
12 tiffcp combines one or more files created according to the Tag Image
13 File Format, Revision 6.0 into a single TIFF file. Because the output
14 file may be compressed using a different algorithm than the input
15 files, tiffcp is most often used to convert between different compres‐
16 sion schemes.
17
18 By default, tiffcp will copy all the understood tags in a TIFF direc‐
19 tory of an input file to the associated directory in the output file.
20
21 tiffcp can be used to reorganize the storage characteristics of data in
22 a file, but it is explicitly intended to not alter or convert the image
23 data content in any way.
24
26 -a Append to an existing output file instead of overwriting it.
27
28 -b image
29 subtract the following monochrome image from all others pro‐
30 cessed. This can be used to remove a noise bias from a set of
31 images. This bias image is typically an image of noise the cam‐
32 era saw with its shutter closed.
33
34 -B Force output to be written with Big-Endian byte order. This op‐
35 tion only has an effect when the output file is created or over‐
36 written and not when it is appended to.
37
38 -C Suppress the use of ``strip chopping'' when reading images that
39 have a single strip/tile of uncompressed data.
40
41 -c Specify the compression to use for data written to the output
42 file: none for no compression, packbits for PackBits compres‐
43 sion, lzw for Lempel-Ziv & Welch compression, zip for Deflate
44 compression, lzma for LZMA2 compression, jpeg for baseline JPEG
45 compression, g3 for CCITT Group 3 (T.4) compression, g4 for
46 CCITT Group 4 (T.6) compression, or sgilog for SGILOG compres‐
47 sion. By default tiffcp will compress data according to the
48 value of the Compression tag found in the source file.
49
50 The CCITT Group 3 and Group 4 compression algorithms can only be
51 used with bilevel data.
52
53 Group 3 compression can be specified together with several
54 T.4-specific options: 1d for 1-dimensional encoding, 2d for
55 2-dimensional encoding, and fill to force each encoded scanline
56 to be zero-filled so that the terminating EOL code lies on a
57 byte boundary. Group 3-specific options are specified by ap‐
58 pending a ``:''-separated list to the ``g3'' option; e.g. -c
59 g3:2d:fill to get 2D-encoded data with byte-aligned EOL codes.
60
61 LZW, Deflate and LZMA2 compression can be specified together
62 with a predictor value. A predictor value of 2 causes each scan‐
63 line of the output image to undergo horizontal differencing be‐
64 fore it is encoded; a value of 1 forces each scanline to be en‐
65 coded without differencing. A value 3 is for floating point pre‐
66 dictor which you can use if the encoded data are in floating
67 point format. LZW-specific options are specified by appending a
68 ``:''-separated list to the ``lzw'' option; e.g. -c lzw:2 for
69 LZW compression with horizontal differencing.
70
71 Deflate and LZMA2 encoders support various compression levels
72 (or encoder presets) set as character ``p'' and a preset number.
73 ``p1'' is the fastest one with the worst compression ratio and
74 ``p9'' is the slowest but with the best possible ratio; e.g. -c
75 zip:3:p9 for Deflate encoding with maximum compression level and
76 floating point predictor.
77
78 For the Deflate codec, and in a libtiff build with libdeflate
79 enabled, ``p12`` is actually the maximum level.
80
81 For the Deflate codec, and in a libtiff build with libdeflate
82 enabled, ``s0`` can be used to require zlib to be used, and
83 ``s1`` for libdeflate (defaults to libdeflate when it is avail‐
84 able).
85
86 -f Specify the bit fill order to use in writing output data. By
87 default, tiffcp will create a new file with the same fill order
88 as the original. Specifying -f lsb2msb will force data to be
89 written with the FillOrder tag set to LSB2MSB, while -f msb2lsb
90 will force data to be written with the FillOrder tag set to
91 MSB2LSB.
92
93 -i Ignore non-fatal read errors and continue processing of the in‐
94 put file.
95
96 -l Specify the length of a tile (in pixels). tiffcp attempts to
97 set the tile dimensions so that no more than 8 kilobytes of data
98 appear in a tile.
99
100 -L Force output to be written with Little-Endian byte order. This
101 option only has an effect when the output file is created or
102 overwritten and not when it is appended to.
103
104 -M Suppress the use of memory-mapped files when reading images.
105
106 -o offset
107 Set initial directory offset.
108
109 -p Specify the planar configuration to use in writing image data
110 that has one 8-bit sample per pixel. By default, tiffcp will
111 create a new file with the same planar configuration as the
112 original. Specifying -p contig will force data to be written
113 with multi-sample data packed together, while -p separate will
114 force samples to be written in separate planes.
115
116 -r Specify the number of rows (scanlines) in each strip of data
117 written to the output file. By default (or when value 0 is
118 specified), tiffcp attempts to set the rows/strip that no more
119 than 8 kilobytes of data appear in a strip. If you specify spe‐
120 cial value -1 it will results in infinite number of the rows per
121 strip. The entire image will be the one strip in that case.
122
123 -s Force the output file to be written with data organized in
124 strips (rather than tiles).
125
126 -t Force the output file to be written with data organized in tiles
127 (rather than strips). options can be used to force the resultant
128 image to be written as strips or tiles of data, respectively.
129
130 -w Specify the width of a tile (in pixels). tiffcp attempts to set
131 the tile dimensions so that no more than 8 kilobytes of data ap‐
132 pear in a tile. tiffcp attempts to set the tile dimensions so
133 that no more than 8 kilobytes of data appear in a tile.
134
135 -x Force the output file to be written with PAGENUMBER value in se‐
136 quence.
137
138 -8 Write BigTIFF instead of classic TIFF format.
139
140 -,=character
141 substitute character for `,' in parsing image directory indices
142 in files. This is necessary if filenames contain commas. Note
143 that -,= with whitespace immediately following will disable the
144 special meaning of the `,' entirely. See examples.
145
146 -m size
147 Set maximum memory allocation size (in MiB). The default is
148 256MiB. Set to 0 to disable the limit.
149
151 The following concatenates two files and writes the result using LZW
152 encoding:
153 tiffcp -c lzw a.tif b.tif result.tif
154
155 To convert a G3 1d-encoded TIFF to a single strip of G4-encoded data
156 the following might be used:
157 tiffcp -c g4 -r 10000 g3.tif g4.tif
158 (1000 is just a number that is larger than the number of rows in the
159 source file.)
160
161 To extract a selected set of images from a multi-image TIFF file, the
162 file name may be immediately followed by a `,' separated list of image
163 directory indices. The first image is always in directory 0. Thus, to
164 copy the 1st and 3rd images of image file ``album.tif'' to ``re‐
165 sult.tif'':
166 tiffcp album.tif,0,2 result.tif
167
168 A trailing comma denotes remaining images in sequence. The following
169 command will copy all image with except the first one:
170 tiffcp album.tif,1, result.tif
171
172 Given file ``CCD.tif'' whose first image is a noise bias followed by
173 images which include that bias, subtract the noise from all those im‐
174 ages following it (while decompressing) with the command:
175 tiffcp -c none -b CCD.tif CCD.tif,1, result.tif
176
177 If the file above were named ``CCD,X.tif'', the -,= option would be re‐
178 quired to correctly parse this filename with image numbers, as follows:
179 tiffcp -c none -,=% -b CCD,X.tif CCD,X%1%.tif result.tif
180
182 pal2rgb(1), tiffinfo(1), tiffcmp(1), tiffmedian(1), tiffsplit(1),
183 libtiff(3TIFF)
184
185 Libtiff library home page: http://www.simplesystems.org/libtiff/
186
187
188
189libtiff February 24, 2007 TIFFCP(1)