Blame man/tiffcrop.1

Packit 7838c8
.\" $Id: tiffcrop.1,v 1.8 2016-09-25 20:05:52 bfriesen Exp $
Packit 7838c8
.\" tiffcrop -- a port of tiffcp.c extended to include extended processing of images
Packit 7838c8
.\" 
Packit 7838c8
.\" Original code:
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
.\" Additional code Copyright (c) 2006-2009 Richard Nolde 
Packit 7838c8
.\" Lasted Updated 9/2009
Packit 7838c8
.\" .if n .po 0
Packit 7838c8
.TH "TIFFCROP" "1" "December, 2008" "libtiff" ""
Packit 7838c8
.SH "NAME"
Packit 7838c8
tiffcrop \- select, copy, crop, convert, extract, and/or process one or more
Packit 7838c8
.SM TIFF
Packit 7838c8
files.
Packit 7838c8
.SH "SYNOPSIS"
Packit 7838c8
.B tiffcrop
Packit 7838c8
[
Packit 7838c8
.I options
Packit 7838c8
]
Packit 7838c8
.I "src1.tif ... srcN.tif dst.tif"
Packit 7838c8
.SH "DESCRIPTION"
Packit 7838c8
.I Tiffcrop
Packit 7838c8
processes one or more files created according
Packit 7838c8
to the Tag Image File Format, Revision 6.0, specification
Packit 7838c8
into one or more
Packit 7838c8
.SM TIFF
Packit 7838c8
file(s).
Packit 7838c8
.I Tiffcrop
Packit 7838c8
is most often used to extract portions of an image for processing 
Packit 7838c8
with bar code recognizer or OCR software when that software cannot 
Packit 7838c8
restrict the region of interest to a specific portion of the image 
Packit 7838c8
or to improve efficiency when the regions of interest must be rotated.
Packit 7838c8
It can also be used to subdivide all or part of a processed image into 
Packit 7838c8
smaller sections and export individual images or sections of images
Packit 7838c8
as separate files or separate images within one or more files derived
Packit 7838c8
from the original input image or images.
Packit 7838c8
.PP 
Packit 7838c8
The available functions can be grouped broadly into three classes:
Packit 7838c8
.IP 
Packit 7838c8
Those that select individual images or sections of images from the input files.
Packit 7838c8
The options \-N for sequences or lists of individual images in the input files,
Packit 7838c8
\-Z for zones, \-z for regions, \-X and \-Y for fixed sized selections,
Packit 7838c8
\-m for margins, \-U for units, and \-E for edge reference provide a variety of 
Packit 7838c8
ways to specify portions of the input image.
Packit 7838c8
.IP 
Packit 7838c8
Those that allow the individual images or selections to be exported to one or
Packit 7838c8
more output files in different groupings and control the organization of the 
Packit 7838c8
data in the output images. The options \-P for page size grouping, \-S for 
Packit 7838c8
subdivision into columns and rows and \-e for export mode options that produce
Packit 7838c8
one or more files from each input image. The options \-r, \-s, \-t, \-w  control 
Packit 7838c8
strip and tile format and sizes while \-B \-L \-c \-f modify the endian addressing
Packit 7838c8
scheme, the compression options, and the bit fill sequence of images as they
Packit 7838c8
are written.
Packit 7838c8
.IP 
Packit 7838c8
Those that perform some action on each image that is selected from the input file.
Packit 7838c8
The options include \-R for rotate, \-I for inversion of the photometric 
Packit 7838c8
interpretation and/or data values, and \-F to flip (mirror) the image horizontally
Packit 7838c8
or vertically.
Packit 7838c8
.PP 
Packit 7838c8
Packit 7838c8
Functions are applied to the input image(s) in the following order:
Packit 7838c8
cropping, fixed area extraction, zone and region extraction, 
Packit 7838c8
inversion, mirroring, rotation.
Packit 7838c8
.PP 
Packit 7838c8
Functions are applied to the output image(s) in the following order:
Packit 7838c8
export mode options for grouping zones, regions, or images into
Packit 7838c8
one or more files,
Packit 7838c8
.I or
Packit 7838c8
row and column divisions with output margins,
Packit 7838c8
.I or
Packit 7838c8
page size divisions with page orientation options.
Packit 7838c8
.PP 
Packit 7838c8
Finally, strip, tile, byte order, output resolution, and compression options are 
Packit 7838c8
applied to all output images.
Packit 7838c8
.PP 
Packit 7838c8
The output file(s) may be organized and compressed using a different
Packit 7838c8
algorithm from the input files.
Packit 7838c8
By default, 
Packit 7838c8
.I tiffcrop
Packit 7838c8
will copy all the understood tags in a
Packit 7838c8
.SM TIFF
Packit 7838c8
directory of an input file to the associated directory in the output file.
Packit 7838c8
Options can be used to force the resultant image to be written as strips 
Packit 7838c8
or tiles of data, respectively.
Packit 7838c8
.PP 
Packit 7838c8
.I Tiffcrop
Packit 7838c8
can be used to reorganize the storage characteristics of data
Packit 7838c8
in a file, and to reorganize, extract, rotate, and otherwise
Packit 7838c8
process the image data as specified at the same time whereas 
Packit 7838c8
tiffcp does not alter the image data within the file. 
Packit 7838c8
.PP 
Packit 7838c8
Using the options for selecting individual input images and the 
Packit 7838c8
options for exporting images and/or segments defined as zones or
Packit 7838c8
regions of each input image,
Packit 7838c8
.I tiffcrop
Packit 7838c8
can perform the functions of tiffcp and tiffsplit in a single pass
Packit 7838c8
while applying multiple operations to individual selections or images.
Packit 7838c8
.PP 
Packit 7838c8
.SH "OPTIONS"
Packit 7838c8
.TP 
Packit 7838c8
.B \-h
Packit 7838c8
Display the syntax summary for tiffcrop.
Packit 7838c8
.TP 
Packit 7838c8
.B \-v
Packit 7838c8
Report the current version and last modification date for tiffcrop.
Packit 7838c8
.TP 
Packit 7838c8
.B \-N odd|even|#,#\-#,#|last
Packit 7838c8
Specify one or more series or range(s) of images within each file to process.
Packit 7838c8
The words
Packit 7838c8
.B odd
Packit 7838c8
or
Packit 7838c8
.B even
Packit 7838c8
may be used to specify all odd or even numbered images counting from one.
Packit 7838c8
Note that internally, TIFF images are numbered from zero rather than one
Packit 7838c8
but since this convention is not obvious to most users, tiffcrop used 1
Packit 7838c8
to specifiy the first image in a multipage file.  The word
Packit 7838c8
.B last 
Packit 7838c8
may be used in place of a number in the sequence to indicate the 
Packit 7838c8
final image in the file without knowing how many images there are.
Packit 7838c8
Ranges of images may be specified with a dash and multiple sets
Packit 7838c8
can be indicated by joining them in a comma\-separated list. eg. use
Packit 7838c8
.B \-N 1,5\-7,last 
Packit 7838c8
to process the 1st, 5th through 7th, and final image in the file.
Packit 7838c8
.TP 
Packit 7838c8
.B \-E top|bottom|left|right
Packit 7838c8
Specify the top, bottom, left, or right edge as the reference from
Packit 7838c8
which to calcuate the width and length of crop regions or sequence
Packit 7838c8
of postions for zones. When used with the \-e option for exporting
Packit 7838c8
zones or regions, the reference edge determines how composite images
Packit 7838c8
are arranged. Using \-E left or right causes successive zones or 
Packit 7838c8
regions to be merged horizontally whereas using \-E top or bottom
Packit 7838c8
causes successive zones or regions to be arranged vertically. This 
Packit 7838c8
option has no effect on export layout when multiple zones or regions
Packit 7838c8
are not being exported to composite images. Edges may be abbreviated
Packit 7838c8
to the first letter.
Packit 7838c8
.TP 
Packit 7838c8
.B \-e combined|divided|image|multiple|separate
Packit 7838c8
Specify the export mode for images and selections from input images.
Packit 7838c8
The final filename on the command line is considered to be the 
Packit 7838c8
destination file or filename stem for automatically generated 
Packit 7838c8
sequences of files. Modes may be abbreviated to the first letter.
Packit 7838c8
.IP 
Packit 7838c8
combined   All images and selections are written to a single file with
Packit 7838c8
multiple selections from one image combined into a single image (default)
Packit 7838c8
.IP 
Packit 7838c8
divided    All images and selections are written to a single file
Packit 7838c8
with each selection from one image written to a new image
Packit 7838c8
.IP 
Packit 7838c8
image      Each input image is written to a new file (numeric filename sequence)
Packit 7838c8
with multiple selections from the image combined into one image
Packit 7838c8
.IP 
Packit 7838c8
multiple   Each input image is written to a new file (numeric filename sequence)
Packit 7838c8
with each selection from the image written to a new image
Packit 7838c8
.IP 
Packit 7838c8
separate   Individual selections from each image are written to separate files
Packit 7838c8
.TP 
Packit 7838c8
.B \-U in|cm|px
Packit 7838c8
Specify the type of units to apply to dimensions for margins and 
Packit 7838c8
crop regions for input and output images. Inches or centimeters 
Packit 7838c8
are converted to pixels using the resolution unit specified in the 
Packit 7838c8
TIFF file (which defaults to inches if not specified in the IFD).
Packit 7838c8
.TP 
Packit 7838c8
.B \-m #,#,#,#
Packit 7838c8
Specify margins to be removed from the input image. The order must 
Packit 7838c8
be top, left, bottom, right with only commas separating the elements 
Packit 7838c8
of the list. Margins are scaled according to the current units and 
Packit 7838c8
removed before any other extractions are computed..
Packit 7838c8
.TP 
Packit 7838c8
.B \-X #
Packit 7838c8
Set the horizontal (X\-axis) dimension of a region to extract relative to 
Packit 7838c8
the specified origin reference. If the origin is the top or bottom
Packit 7838c8
edge, the X axis value will be assumed to start at the left edge.
Packit 7838c8
.TP 
Packit 7838c8
.B \-Y #
Packit 7838c8
Set the vertical (Y\-axis) dimension of a region to extract relative to
Packit 7838c8
the specified origin reference. If the origin is the left or right
Packit 7838c8
edge, the Y axis value will be assumed to start at the top.
Packit 7838c8
.TP 
Packit 7838c8
.B \-Z  #:#,#:#  
Packit 7838c8
Specify zones of the image designated as position X of Y equal sized portions
Packit 7838c8
measured from the reference edge,  eg 1:3 would be first third of the
Packit 7838c8
image starting from the reference edge minus any margins specified
Packit 7838c8
for the confining edges. Multiple zones can be specified as a comma
Packit 7838c8
separated list but they must reference the same edge. To extract the
Packit 7838c8
top quarter and the bottom third of an image you would use 
Packit 7838c8
.B \-Z 1:4,3:3.
Packit 7838c8
.TP 
Packit 7838c8
.B \-z x1,y1,x2,y2: ... :xN,yN,xN+1,yN+1 
Packit 7838c8
Specify a series of coordinates to define regions for processing and exporting.
Packit 7838c8
The coordinates represent the top left and lower right corners of each region 
Packit 7838c8
in the current units, eg inch, cm, or pixels. Pixels are counted from one to 
Packit 7838c8
width or height and inches or cm are calculated from image resolution data.
Packit 7838c8
Packit 7838c8
Each colon delimited series of four values represents the horizontal and vertical 
Packit 7838c8
offsets from the top and left edges of the image, regardless of the edge specified
Packit 7838c8
with the \-E option. The first and third values represent the horizontal offsets of 
Packit 7838c8
the corner points from the left edge while the second and fourth values represent 
Packit 7838c8
the vertical offsets from the top edge.
Packit 7838c8
.TP 
Packit 7838c8
.B \-F horiz|vert
Packit 7838c8
Flip, ie mirror, the image or extracted region horizontally or vertically.
Packit 7838c8
.TP 
Packit 7838c8
.B \-R 90|180|270
Packit 7838c8
Rotate the image or extracted region 90, 180, or 270 degrees clockwise.
Packit 7838c8
.TP 
Packit 7838c8
.B \\-I [black|white|data|both]
Packit 7838c8
Invert color space, eg dark to light for bilevel and grayscale images.
Packit 7838c8
This can be used to modify negative images to positive or to correct
Packit 7838c8
images that have the PHOTOMETRIC_INTERPRETATIN tag set incorrectly.
Packit 7838c8
If the value is black or white, the PHOTOMETRIC_INTERPRETATION tag is set to 
Packit 7838c8
MinIsBlack or MinIsWhite, without altering the image data. If the argument 
Packit 7838c8
is data or both, the data values of the image are modified. Specifying both 
Packit 7838c8
inverts the data and the PHOTOMETRIC_INTERPRETATION tag, whereas using data
Packit 7838c8
inverts the data but not the PHOTOMETRIC_INTERPRETATION tag.
Packit 7838c8
No support for modifying the color space of color images in this release.
Packit 7838c8
.TP 
Packit 7838c8
.B \-H #
Packit 7838c8
Set the horizontal resolution of output images to #
Packit 7838c8
expressed in the current units.
Packit 7838c8
.TP 
Packit 7838c8
.B \-V #
Packit 7838c8
Set the vertical resolution of the output images to #
Packit 7838c8
expressed in the current units.
Packit 7838c8
.TP 
Packit 7838c8
.B \-J #
Packit 7838c8
Set the horizontal margin of an output page size to #
Packit 7838c8
expressed in the current units when sectioning image into columns x rows
Packit 7838c8
subimages using the \-S cols:rows option.
Packit 7838c8
.TP 
Packit 7838c8
.B \-K #
Packit 7838c8
Set the vertical margin of an output page size to # 
Packit 7838c8
expressed in the current units when sectioning image into columns x rows
Packit 7838c8
submiages using the \-S cols:rows option.
Packit 7838c8
.TP
Packit 7838c8
.B \-O portrait|landscape|auto
Packit 7838c8
Set the output orientation of the pages or sections.
Packit 7838c8
Auto will use the arrangement that requires the fewest pages.
Packit 7838c8
This option is only meaningful in conjunction with the -P
Packit 7838c8
option to format an image to fit on a specific paper size.
Packit 7838c8
.TP 
Packit 7838c8
.B \-P page
Packit 7838c8
Format the output images to fit on page size paper. Use
Packit 7838c8
\-P list to show the supported page sizes and dimensions.
Packit 7838c8
You can define a custom page size by entering the width and length of the
Packit 7838c8
page in the current units with the following format #.#x#.#.
Packit 7838c8
.TP 
Packit 7838c8
.B \-S cols:rows
Packit 7838c8
Divide each image into cols across and rows down equal sections.
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 jpeg 
Packit 7838c8
for baseline JPEG compression.
Packit 7838c8
.B zip
Packit 7838c8
for Deflate compression,
Packit 7838c8
.B g3
Packit 7838c8
for CCITT Group 3 (T.4) compression,
Packit 7838c8
and
Packit 7838c8
.B g4
Packit 7838c8
for CCITT Group 4 (T.6) compression.
Packit 7838c8
By default
Packit 7838c8
.I tiffcrop
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
Packit 7838c8
compression can be specified together with a 
Packit 7838c8
.I predictor
Packit 7838c8
value.
Packit 7838c8
A predictor value of 2 causes
Packit 7838c8
each scanline of the output image to undergo horizontal
Packit 7838c8
differencing before it is encoded; a value
Packit 7838c8
of 1 forces each scanline to be encoded without differencing.
Packit 7838c8
LZW\-specific options are specified by appending a ``:''\-separated
Packit 7838c8
list to the ``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
.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 tiffcrop
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 Tiffcrop
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
.B \-p
Packit 7838c8
Specify the planar configuration to use in writing image data
Packit 7838c8
that has more than one sample per pixel.
Packit 7838c8
By default,
Packit 7838c8
.I tiffcrop
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 tiffcrop
Packit 7838c8
attempts to set the rows/strip that no more than 8 kilobytes of 
Packit 7838c8
data appear in a strip. If you specify the 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
Packit 7838c8
(rather than strips).
Packit 7838c8
.TP 
Packit 7838c8
.B \-w
Packit 7838c8
Specify the width of a tile (in pixels).
Packit 7838c8
.I tiffcrop
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
.I tiffcrop
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
Debug and dump facility
Packit 7838c8
.B \-D opt1:value1,opt2:value2,opt3:value3:opt4:value4
Packit 7838c8
Display program progress and/or dump raw data to non\-TIFF files.
Packit 7838c8
Options include the following and must be joined as a comma
Packit 7838c8
separated list. The use of this option is generally limited to
Packit 7838c8
program debugging and development of future options. An equal sign
Packit 7838c8
may be substituted for the colon in option:value pairs.
Packit 7838c8
.IP
Packit 7838c8
debug:N         Display limited program progress indicators where larger N
Packit 7838c8
increase the level of detail.
Packit 7838c8
.IP
Packit 7838c8
format:txt|raw  Format any logged data as ASCII text or raw binary 
Packit 7838c8
values. ASCII text dumps include strings of ones and zeroes representing
Packit 7838c8
the binary values in the image data plus identifying headers.
Packit 7838c8
.IP
Packit 7838c8
level:N         Specify the level of detail presented in the dump files.
Packit 7838c8
This can vary from dumps of the entire input or output image data to dumps
Packit 7838c8
of data processed by specific functions. Current range of levels is 1 to 3.
Packit 7838c8
.IP
Packit 7838c8
input:full\-path\-to\-directory/input\-dumpname
Packit 7838c8
.IP
Packit 7838c8
output:full\-path\-to\-directory/output\-dumpname
Packit 7838c8
.IP
Packit 7838c8
When dump files are being written, each image will be written to a separate
Packit 7838c8
file with the name built by adding a numeric sequence value to the dumpname
Packit 7838c8
and an extension of .txt for ASCII dumps or .bin for binary dumps.
Packit 7838c8
Packit 7838c8
The four debug/dump options are independent, though it makes little sense to
Packit 7838c8
specify a dump file without specifying a detail level.
Packit 7838c8
.IP
Packit 7838c8
Note: Tiffcrop may be compiled with -DDEVELMODE to enable additional very
Packit 7838c8
 low level debug reporting.
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
tiffcrop \-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
tiffcrop \-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 
Packit 7838c8
use the \-N option described above. Thus, to copy the 1st and 3rd
Packit 7838c8
images of image file "album.tif" to "result.tif":
Packit 7838c8
.RS
Packit 7838c8
.nf 
Packit 7838c8
tiffcrop \-N 1,3 album.tif result.tif
Packit 7838c8
.fi 
Packit 7838c8
.RE
Packit 7838c8
.PP 
Packit 7838c8
Invert a bilevel image scan of a microfilmed document and crop off margins of
Packit 7838c8
0.25 inches on the left and right, 0.5 inch on the top, and 0.75 inch on the
Packit 7838c8
bottom. From the remaining portion of the image, select the second and third
Packit 7838c8
quarters, ie, one half of the area left from the center to each margin. 
Packit 7838c8
.RS
Packit 7838c8
tiffcrop \-U in \-m 0.5,0.25,0.75,0.25 \-E left \-Z 2:4,3:4 \-I both MicrofilmNegative.tif MicrofilmPostiveCenter.tif
Packit 7838c8
.fi 
Packit 7838c8
.RE
Packit 7838c8
.PP 
Packit 7838c8
Extract only the final image of a large Architectural E sized 
Packit 7838c8
multipage TIFF file and rotate it 90 degrees clockwise while 
Packit 7838c8
reformatting the output to fit on tabloid sized sheets with one 
Packit 7838c8
quarter of an inch on each side:
Packit 7838c8
.RS
Packit 7838c8
tiffcrop \-N last \-R 90 \-O auto \-P tabloid \-U in \-J 0.25 \-K 0.25 \-H 300 \-V 300 Big\-PlatMap.tif BigPlatMap\-Tabloid.tif 
Packit 7838c8
.fi 
Packit 7838c8
.RE
Packit 7838c8
The output images will have a specified resolution of 300 dpi in both
Packit 7838c8
directions. The orientation of each page will be determined by whichever
Packit 7838c8
choice requires the fewest pages. To specify a specific orientation, use
Packit 7838c8
the portrait or landscape option. The paper size option does not resample
Packit 7838c8
the image. It breaks each original image into a series of smaller images
Packit 7838c8
that will fit on the target paper size at the specified resolution.
Packit 7838c8
.fi 
Packit 7838c8
.RE
Packit 7838c8
.PP 
Packit 7838c8
Extract two regions 2048 pixels wide by 2048 pixels high from each page of
Packit 7838c8
a multi\-page input file and write each region to a separate output file.
Packit 7838c8
.RS
Packit 7838c8
tiffcrop \-U px \-z 1,1,2048,2048:1,2049,2048,4097 \-e separate  CheckScans.tiff Check
Packit 7838c8
.fi 
Packit 7838c8
.RE
Packit 7838c8
The output file names will use the stem Check with a numeric suffix which is
Packit 7838c8
incremented for each region of each image, eg Check\-001.tiff, Check\-002.tiff ...
Packit 7838c8
Check\-NNN.tiff. To produce a unique file for each page of the input image
Packit 7838c8
with one new image for each region of the input image on that page, change
Packit 7838c8
the export option to \-e multiple.
Packit 7838c8
Packit 7838c8
.SH "NOTES"
Packit 7838c8
.PP 
Packit 7838c8
In general, bilevel, grayscale, palette and RGB(A) data with bit depths
Packit 7838c8
from 1 to 32 bits should work in both interleaved and separate plane
Packit 7838c8
formats. Unlike tiffcp, tiffcrop can read and write tiled images with
Packit 7838c8
bits per sample that are not a multiple of 8 in both interleaved and
Packit 7838c8
separate planar format. Floating point data types are supported at 
Packit 7838c8
bit depts of 16, 24, 32 and 64 bits per sample. 
Packit 7838c8
.PP
Packit 7838c8
Not all images can be converted from one compression scheme to another.
Packit 7838c8
Data with some photometric interpretations and/or bit depths are tied to 
Packit 7838c8
specific compression schemes and vice-versa, e.g. Group 3/4 compression
Packit 7838c8
is only usable for bilevel data. JPEG compression is only usable on 8
Packit 7838c8
bit per sample data (or 12 bit if 
Packit 7838c8
.I LibTIFF
Packit 7838c8
was compiled with 12 bit JPEG support). Support for OJPEG compressed 
Packit 7838c8
images is problematic at best. Since OJPEG compression is no longer 
Packit 7838c8
supported for writing images with LibTIFF, these images will be updated
Packit 7838c8
to the newer JPEG compression when they are copied or processed. This
Packit 7838c8
may cause the image to appear color shifted or distorted after conversion.
Packit 7838c8
In some cases, it is possible to remove the original compression from 
Packit 7838c8
image data using the option -cnone.
Packit 7838c8
.PP
Packit 7838c8
Tiffcrop does not currently provide options to up or downsample data to 
Packit 7838c8
different bit depths or convert data from one photometric interpretation 
Packit 7838c8
to another, e.g. 16 bits per sample to 8 bits per sample or RGB to grayscale. 
Packit 7838c8
.PP
Packit 7838c8
Tiffcrop is very loosely derived from code in
Packit 7838c8
.I tiffcp
Packit 7838c8
with extensive modifications and additions to support the selection of input 
Packit 7838c8
images and regions and the exporting of them to one or more output files in 
Packit 7838c8
various groupings. The image manipulation routines are entirely new and 
Packit 7838c8
additional ones may be added in the future. It will handle tiled images with 
Packit 7838c8
bit depths that are not a multiple of eight that tiffcp may refuse to read.
Packit 7838c8
.PP 
Packit 7838c8
.I Tiffcrop
Packit 7838c8
was designed to handle large files containing many moderate sized images 
Packit 7838c8
with memory usage that is independent of the number of images in the file. 
Packit 7838c8
In order to support compression modes that are not based on individual 
Packit 7838c8
scanlines, e.g. JPEG, it now reads images by strip or tile rather than by 
Packit 7838c8
indvidual scanlines. In addition to the memory required by the input and 
Packit 7838c8
output buffers associated with
Packit 7838c8
.I LibTIFF
Packit 7838c8
one or more buffers at least as large as the largest image to be read are
Packit 7838c8
required. The design favors large volume document processing uses over 
Packit 7838c8
scientific or graphical manipulation of large datasets as might be found 
Packit 7838c8
in research or remote sensing scenarios.
Packit 7838c8
.SH "SEE ALSO"
Packit 7838c8
.BR pal2rgb (1),
Packit 7838c8
.BR tiffinfo (1),
Packit 7838c8
.BR tiffcmp (1),
Packit 7838c8
.BR tiffcp (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/
Packit 7838c8