tiffcp.1 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. .\"
  2. .\" Copyright (c) 1988-1997 Sam Leffler
  3. .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
  4. .\"
  5. .\" Permission to use, copy, modify, distribute, and sell this software and
  6. .\" its documentation for any purpose is hereby granted without fee, provided
  7. .\" that (i) the above copyright notices and this permission notice appear in
  8. .\" all copies of the software and related documentation, and (ii) the names of
  9. .\" Sam Leffler and Silicon Graphics may not be used in any advertising or
  10. .\" publicity relating to the software without the specific, prior written
  11. .\" permission of Sam Leffler and Silicon Graphics.
  12. .\"
  13. .\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
  14. .\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
  15. .\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  16. .\"
  17. .\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
  18. .\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
  19. .\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  20. .\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
  21. .\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  22. .\" OF THIS SOFTWARE.
  23. .\"
  24. .if n .po 0
  25. .TH TIFFCP 1 "February 24, 2007" "libtiff"
  26. .SH NAME
  27. tiffcp \- copy (and possibly convert) a
  28. .SM TIFF
  29. file
  30. .SH SYNOPSIS
  31. .B tiffcp
  32. [
  33. .I options
  34. ]
  35. .I "src1.tif ... srcN.tif dst.tif"
  36. .SH DESCRIPTION
  37. .I tiffcp
  38. combines one or more files created according
  39. to the Tag Image File Format, Revision 6.0
  40. into a single
  41. .SM TIFF
  42. file.
  43. Because the output file may be compressed using a different
  44. algorithm than the input files,
  45. .I tiffcp
  46. is most often used to convert between different compression
  47. schemes.
  48. .PP
  49. By default,
  50. .I tiffcp
  51. will copy all the understood tags in a
  52. .SM TIFF
  53. directory of an input
  54. file to the associated directory in the output file.
  55. .PP
  56. .I tiffcp
  57. can be used to reorganize the storage characteristics of data
  58. in a file, but it is explicitly intended to not alter or convert
  59. the image data content in any way.
  60. .SH OPTIONS
  61. .TP
  62. .B \-a
  63. Append to an existing output file instead of overwriting it.
  64. .TP
  65. .BI \-b " image"
  66. subtract the following monochrome image from all others
  67. processed. This can be used to remove a noise bias
  68. from a set of images. This bias image is typically an
  69. image of noise the camera saw with its shutter closed.
  70. .TP
  71. .B \-B
  72. Force output to be written with Big-Endian byte order.
  73. This option only has an effect when the output file is created or
  74. overwritten and not when it is appended to.
  75. .TP
  76. .B \-C
  77. Suppress the use of ``strip chopping'' when reading images
  78. that have a single strip/tile of uncompressed data.
  79. .TP
  80. .B \-c
  81. Specify the compression to use for data written to the output file:
  82. .B none
  83. for no compression,
  84. .B packbits
  85. for PackBits compression,
  86. .B lzw
  87. for Lempel-Ziv & Welch compression,
  88. .B zip
  89. for Deflate compression,
  90. .B lzma
  91. for LZMA2 compression,
  92. .B jpeg
  93. for baseline JPEG compression,
  94. .B g3
  95. for CCITT Group 3 (T.4) compression,
  96. .B g4
  97. for CCITT Group 4 (T.6) compression,
  98. or
  99. .B sgilog
  100. for SGILOG compression.
  101. By default
  102. .I tiffcp
  103. will compress data according to the value of the
  104. .I Compression
  105. tag found in the source file.
  106. .IP
  107. The
  108. .SM CCITT
  109. Group 3 and Group 4 compression algorithms can only
  110. be used with bilevel data.
  111. .IP
  112. Group 3 compression can be specified together with several
  113. T.4-specific options:
  114. .B 1d
  115. for 1-dimensional encoding,
  116. .B 2d
  117. for 2-dimensional encoding,
  118. and
  119. .B fill
  120. to force each encoded scanline to be zero-filled so that the
  121. terminating EOL code lies on a byte boundary.
  122. Group 3-specific options are specified by appending a ``:''-separated
  123. list to the ``g3'' option; e.g.
  124. .B "\-c g3:2d:fill"
  125. to get 2D-encoded data with byte-aligned EOL codes.
  126. .IP
  127. .SM LZW, Deflate
  128. and
  129. .SM LZMA2
  130. compression can be specified together with a
  131. .I predictor
  132. value. A predictor value of 2 causes each scanline of the output image to
  133. undergo horizontal differencing before it is encoded; a value of 1 forces each
  134. scanline to be encoded without differencing. A value 3 is for floating point
  135. predictor which you can use if the encoded data are in floating point format.
  136. LZW-specific options are specified by appending a ``:''-separated list to the
  137. ``lzw'' option; e.g.
  138. .B "\-c lzw:2"
  139. for
  140. .SM LZW
  141. compression with horizontal differencing.
  142. .IP
  143. .SM Deflate
  144. and
  145. .SM LZMA2
  146. encoders support various compression levels (or encoder presets) set as
  147. character ``p'' and a preset number. ``p1'' is the fastest one with the worst
  148. compression ratio and ``p9'' is the slowest but with the best possible ratio;
  149. e.g.
  150. .B "\-c zip:3:p9"
  151. for
  152. .SM Deflate
  153. encoding with maximum compression level and floating point predictor.
  154. .IP
  155. For the
  156. .SM Deflate
  157. codec, and in a libtiff build with libdeflate enabled, ``p12`` is
  158. actually the maximum level.
  159. .IP
  160. For the
  161. .SM Deflate
  162. codec, and in a libtiff build with libdeflate enabled, ``s0`` can be used to
  163. require zlib to be used, and ``s1`` for libdeflate (defaults to libdeflate when
  164. it is available).
  165. .TP
  166. .B \-f
  167. Specify the bit fill order to use in writing output data.
  168. By default,
  169. .I tiffcp
  170. will create a new file with the same fill order as the original.
  171. Specifying
  172. .B "\-f lsb2msb"
  173. will force data to be written with the FillOrder tag set to
  174. .SM LSB2MSB,
  175. while
  176. .B "\-f msb2lsb"
  177. will force data to be written with the FillOrder tag set to
  178. .SM MSB2LSB.
  179. .TP
  180. .B \-i
  181. Ignore non-fatal read errors and continue processing of the input file.
  182. .TP
  183. .B \-l
  184. Specify the length of a tile (in pixels).
  185. .I tiffcp
  186. attempts to set the tile dimensions so
  187. that no more than 8 kilobytes of data appear in a tile.
  188. .TP
  189. .B \-L
  190. Force output to be written with Little-Endian byte order.
  191. This option only has an effect when the output file is created or
  192. overwritten and not when it is appended to.
  193. .TP
  194. .B \-M
  195. Suppress the use of memory-mapped files when reading images.
  196. .TP
  197. .BI \-o " offset"
  198. Set initial directory offset.
  199. .TP
  200. .B \-p
  201. Specify the planar configuration to use in writing image data
  202. that has one 8-bit sample per pixel.
  203. By default,
  204. .I tiffcp
  205. will create a new file with the same planar configuration as
  206. the original.
  207. Specifying
  208. .B "\-p contig"
  209. will force data to be written with multi-sample data packed
  210. together, while
  211. .B "\-p separate"
  212. will force samples to be written in separate planes.
  213. .TP
  214. .B \-r
  215. Specify the number of rows (scanlines) in each strip of data
  216. written to the output file.
  217. By default (or when value
  218. .B 0
  219. is specified),
  220. .I tiffcp
  221. attempts to set the rows/strip
  222. that no more than 8 kilobytes of data appear in a strip. If you specify
  223. special value
  224. .B \-1
  225. it will results in infinite number of the rows per strip. The entire image
  226. will be the one strip in that case.
  227. .TP
  228. .B \-s
  229. Force the output file to be written with data organized in strips
  230. (rather than tiles).
  231. .TP
  232. .B \-t
  233. Force the output file to be written with data organized in tiles (rather than
  234. strips). options can be used to force the resultant image to be written as
  235. strips or tiles of data, respectively.
  236. .TP
  237. .B \-w
  238. Specify the width of a tile (in pixels).
  239. .I tiffcp
  240. attempts to set the tile dimensions so that no more than 8 kilobytes of data
  241. appear in a tile.
  242. .I tiffcp
  243. attempts to set the tile dimensions so that no more than 8 kilobytes of data
  244. appear in a tile.
  245. .TP
  246. .B \-x
  247. Force the output file to be written with PAGENUMBER value in sequence.
  248. .TP
  249. .B \-8
  250. Write BigTIFF instead of classic TIFF format.
  251. .TP
  252. .BI \-,= character
  253. substitute
  254. .I character
  255. for `,' in parsing image directory indices
  256. in files. This is necessary if filenames contain commas.
  257. Note that
  258. .B \-,=
  259. with whitespace immediately following will disable
  260. the special meaning of the `,' entirely. See examples.
  261. .TP
  262. .BI \-m " size"
  263. Set maximum memory allocation size (in MiB). The default is 256MiB.
  264. Set to 0 to disable the limit.
  265. .SH EXAMPLES
  266. The following concatenates two files and writes the result using
  267. .SM LZW
  268. encoding:
  269. .RS
  270. .nf
  271. tiffcp \-c lzw a.tif b.tif result.tif
  272. .fi
  273. .RE
  274. .PP
  275. To convert a G3 1d-encoded
  276. .SM TIFF
  277. to a single strip of G4-encoded data the following might be used:
  278. .RS
  279. .nf
  280. tiffcp \-c g4 \-r 10000 g3.tif g4.tif
  281. .fi
  282. .RE
  283. (1000 is just a number that is larger than the number of rows in
  284. the source file.)
  285. To extract a selected set of images from a multi-image TIFF file, the file
  286. name may be immediately followed by a `,' separated list of image directory
  287. indices. The first image is always in directory 0. Thus, to copy the 1st and
  288. 3rd images of image file ``album.tif'' to ``result.tif'':
  289. .RS
  290. .nf
  291. tiffcp album.tif,0,2 result.tif
  292. .fi
  293. .RE
  294. A trailing comma denotes remaining images in sequence. The following command
  295. will copy all image with except the first one:
  296. .RS
  297. .nf
  298. tiffcp album.tif,1, result.tif
  299. .fi
  300. .RE
  301. Given file ``CCD.tif'' whose first image is a noise bias
  302. followed by images which include that bias,
  303. subtract the noise from all those images following it
  304. (while decompressing) with the command:
  305. .RS
  306. .nf
  307. tiffcp \-c none \-b CCD.tif CCD.tif,1, result.tif
  308. .fi
  309. .RE
  310. If the file above were named ``CCD,X.tif'', the
  311. .B \-,=
  312. option would
  313. be required to correctly parse this filename with image numbers,
  314. as follows:
  315. .RS
  316. .nf
  317. tiffcp \-c none \-,=% \-b CCD,X.tif CCD,X%1%.tif result.tif
  318. .SH "SEE ALSO"
  319. .BR pal2rgb (1),
  320. .BR tiffinfo (1),
  321. .BR tiffcmp (1),
  322. .BR tiffmedian (1),
  323. .BR tiffsplit (1),
  324. .BR libtiff (3TIFF)
  325. .PP
  326. Libtiff library home page:
  327. .BR http://www.simplesystems.org/libtiff/