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