2008-05-23 20:18:55 -04:00
. \" $Id: tiffcrop.1,v 1.3 2008-05-24 00:18:57 fwarmerdam Exp $
2007-04-06 10:27:03 -04:00
. \" tiffcrop -- a port of tiffcp.c extended to include cropping of selections
2008-05-23 20:18:55 -04:00
. \"
2007-04-06 10:27:03 -04:00
. \" Original code:
2008-05-23 20:18:55 -04:00
. \"
2007-02-24 09:48:01 -05:00
. \" Copyright (c) 1988-1997 Sam Leffler
. \" Copyright (c) 1991-1997 Silicon Graphics, Inc.
2008-05-23 20:18:55 -04:00
. \"
2007-02-24 09:48:01 -05:00
. \" Permission to use, copy, modify, distribute, and sell this software and
. \" its documentation for any purpose is hereby granted without fee, provided
. \" that (i) the above copyright notices and this permission notice appear in
. \" all copies of the software and related documentation, and (ii) the names of
. \" Sam Leffler and Silicon Graphics may not be used in any advertising or
. \" publicity relating to the software without the specific, prior written
. \" permission of Sam Leffler and Silicon Graphics.
. \"
. \" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
. \" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
. \" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
. \"
. \" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
. \" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
. \" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
. \" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
. \" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
. \" OF THIS SOFTWARE.
2008-05-23 20:18:55 -04:00
. \"
. \" Additional code Copyright (c) 2008 Richard Nolde
. \" Updated 5/2008 Add support for the options below to extract
2007-02-24 09:48:01 -05:00
. \" sections of image(s) and to modify the whole image or selected portion
. \" with rotations, mirroring, and colorscale/colormap inversion of selected
. \" types of TIFF images when appropriate
2008-05-23 20:18:55 -04:00
. \"
2007-02-24 09:48:01 -05:00
. \" Options:
2008-05-23 20:18:55 -04:00
. \" -h Display the syntax guide.
. \" -v Report the version and last build date for tiffcrop
. \" -z x1,y1,x2,y2:x3,y3,x4,y4:..xN,yN,xN + 1, yN + 1
. \" Specify a series of coordinates to define regions
. \" -e c|d|i|m|s Export mode for images and selections from input images
. \" Modes may be abbreviated to the first letter.
. \" combined All images and selections are written to a single file (default)
. \" with multiple selections from one image combined into a single image
. \" divided All images and selections are written to a single file
. \" with each selection from one image written to a new image
. \" image Each input image is written to a new file (numeric filename sequence)
. \" with multiple selections from the image combined into one image
. \" multiple Each input image is written to a new file (numeric filename sequence)
. \" with each selection from the image written to a new image
. \" separate Individual selections from each image are written to separate files
. \" -e a|i|s Export mode for images and selections from input images
. \" a all images and selections are written to a single file (default)
. \" i new file for each source image (numeric filename sequence)
. \" s new file for each selection within each source image
. \" c create a composite image from all selections from an individual image
. \" i create individual images from each selection from an individual image
2007-02-24 09:48:01 -05:00
. \" -U units [in, cm, px ] inches, centimeters or pixels
2007-04-06 10:27:03 -04:00
. \" -H # set horizontal resolution of output images to #
. \" -V # set vertical resolution of output images to #
. \" -J # set horizontal margin of output page to # expressed in current units
. \" -K # set vertical margin of output page to # expressed in current units
. \" -X # horizontal dimension of region to extract expressed in current units
. \" -Y # vertical dimension of region to extract expressed in current units
. \" -O orient orientation for output image, portrait, landscape, auto
. \" -P page page size for output image segments, eg letter, legal, tabloid, etc.
. \" -S cols:rows divide the image into equal sized segments using cols across and rows down
2007-02-24 09:48:01 -05:00
. \" -X # horizontal dimension of region to extract expressed in current units
. \" -Y # vertical dimension of region to extract expressed in current units
. \" -E t|l|r|b edge to use as origin
2007-04-06 10:27:03 -04:00
. \" -m #,#,#,# margins from edges for selection: top, left, bottom, right (comma separated)
. \" -Z #:#,#:# up to 32 zones of the image designated as zone X of Y,
2008-05-23 20:18:55 -04:00
. \" eg 1:3 would be first of three equal portions measured from reference edge
2007-02-24 09:48:01 -05:00
. \" -N odd|even|#,#-#,#|last sequences and ranges of images within file to process
2008-05-23 20:18:55 -04:00
. \" the words odd or even may be used to specify all odd or even numbered images
. \" the word last may be used in place of a number in the sequence to indicate
. \" the final image in the file without knowing how many images there are
2007-02-24 09:48:01 -05:00
. \" -R # rotate image or crop selection by 90,180,or 270 degrees clockwise
. \" -F h|v flip (mirror) image or crop selection horizontally or vertically
2008-05-23 20:18:55 -04:00
. \" -I [black|white|preserve|update]
. \" Invert color space, eg dark to light for bilevel and grayscale images
. \" set the PHOTOMETRIC_INTERPRETATION tag to MinIsBlack or MinIsWhite,
. \" without altering the image data if argument is white or black.
. \" If the argument is preserve or update, the data values are modified:
. \" update inverts the data and the PHOTOMETRIC_INTERPRETATION tag,
. \" preserve inverts the data but not the PHOTOMETRIC_INTERPRETATION tag
. \"
. \" .if n .po 0
.TH "TIFFCROP" "1" "April 06, 2007" "libtiff" ""
.SH "NAME"
tiffcrop \- copy, convert, crop, extract, and/or process one or more
2007-02-24 09:48:01 -05:00
.SM TIFF
2008-05-23 20:18:55 -04:00
files.
.SH "SYNOPSIS"
2007-02-24 09:48:01 -05:00
.B tiffcrop
[
.I options
]
.I "src1.tif ... srcN.tif dst.tif"
2008-05-23 20:18:55 -04:00
.SH "DESCRIPTION"
2007-02-24 09:48:01 -05:00
.I tiffcrop
2008-05-23 20:18:55 -04:00
processes one or more files created according
to the Tag Image File Format, Revision 6.0, specification
into one or more
2007-02-24 09:48:01 -05:00
.SM TIFF
2008-05-23 20:18:55 -04:00
file(s).
.I Tiffcrop
2007-04-06 10:27:03 -04:00
is most often used to extract portions of an image for processing
with bar code recognizer or OCR software when that software cannot
restrict the region of interest to a specific portion of the image
or to improve efficiency when the regions of interest must be rotated.
It can also be used to subdivide all or part of a processed image into
2008-05-23 20:18:55 -04:00
smaller sections and export individual images or sections of images
as separate files or separate images within one or more files derived
from the original input images(s).
.PP
The available functions can be grouped broadly into three classes:
.IP
Those that select individual images or sections of images from the input files.
The options \- Z for Zones, \- z for Regions, \- X and \- Y for fixed sized selections,
\- m for Margins, \- U for units, and \- E for Edge reference provide a variety of
ways to specify portions of the input image.
.IP
Those that allow the individual images or selections to be exported to one or
more output files in different groupings and control the organization of the
data in the output images. The options \- P for Page size grouping, \- S for
Subdivision into columns and rows and \- e for export mode options that produce
one or more files from each input image. The options \- r, \- s, \- t, \- w control
Strip and Tile format and sizes while \- B \- L \- c \- f modify the endian addressing
scheme, the compression options, and the bit fill sequence of images as they
are written.
.IP
Those that perform some action on each image that is selected from the input file.
The options include \- R for Rotate, \- I for Inversion of the Photometric
Interpretation, and \- F to Flip (mirror) the image horizontally or vertically.
.PP
Functions are applied to the input image(s) in the following order:
cropping, fixed area extraction, zone and region extraction,
inversion, mirroring, rotation.
.PP
Functions are applied to the output image(s) in the following order:
export mode options for grouping zones, regions, or images into
one or more files,
.I or
row and column divisions with output margins,
.I or
page size divisions with page orientation options.
.PP
Finally, strip, tile, byte order, output resolution, and compression options are
applied to all output images.
.PP
The output file(s) may be organized and compressed using a different
algorithm from the input files.
2007-02-24 09:48:01 -05:00
By default,
.I tiffcrop
will copy all the understood tags in a
.SM TIFF
directory of an input file to the associated directory in the output file.
2007-04-06 10:27:03 -04:00
Options can be used to force the resultant image to be written as strips
or tiles of data, respectively.
2008-05-23 20:18:55 -04:00
.PP
2007-02-24 09:48:01 -05:00
.I tiffcrop
2007-04-06 10:27:03 -04:00
can be used to reorganize the storage characteristics of data
in a file, and to reorganize, extract, rotate, and otherwise
process the image data as specified at the same time whereas
tiffcp does not alter the image data itself.
2008-05-23 20:18:55 -04:00
.PP
Using the options for selecting individual input images and the
options for exporting images and/or segments defined as zones or
regions of each input image,
.I tiffcrop
can perform the functions of tiffcp and tiffsplit in a single pass
while applying multiple operations to individual selections or images.
.PP
.SH "OPTIONS"
.TP
.B \- h
Display the syntax summary for tiffcrop.
.TP
.B \- v
Report the current version and last modification date for tiffcrop.
.TP
.B \- N odd|even|#,#\-#,#|last
2007-04-06 10:27:03 -04:00
Specify one or more series or range(s) of images within file to process.
The words
2007-02-24 09:48:01 -05:00
.B odd
or
.B even
may be used to specify all odd or even numbered images. The word
.B last
2007-04-06 10:27:03 -04:00
may be used in place of a number in the sequence to indicate the
final image in the file without knowing how many images there are.
Ranges of images may be specified with a dash and multiple sets
2008-05-23 20:18:55 -04:00
can be indicated by joining them in a comma\- separated list. eg. use
.B \- N 1 ,5\-7,last
2007-02-24 09:48:01 -05:00
to process the 1st, 5th through 7th, and final image in the file.
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- E top|bottom|left|right
2007-04-06 10:27:03 -04:00
Specify the top, bottom, left, or right edge as the reference from
which to calcuate the width and length of crop regions or sequence
2008-05-23 20:18:55 -04:00
of postions for zones. When used with the \- e option for exporting
zones or regions, the reference edge determines how composite images
are arranged. Using \- E left or right causes successive zones or
regions to be merged horizontally whereas using \- E top or bottom
causes successive zones or regions to be arranged vertically. This
option has no effect on export layout when multiple zones or regions
are not being exported to composite images. Edges may be abbreviated
to the first letter.
.TP
.B \- e c|d|i|m|s
Specify the export mode for images and selections from input images.
Modes may be abbreviated to the first letter.
.IP
combined All images and selections are written to a single file (default)
with multiple selections from one image combined into a single image
.IP
divided All images and selections are written to a single file
with each selection from one image written to a new image
.IP
image Each input image is written to a new file (numeric filename sequence)
with multiple selections from the image combined into one image
.IP
multiple Each input image is written to a new file (numeric filename sequence)
with each selection from the image written to a new image
.IP
separate Individual selections from each image are written to separate files
.TP
2007-02-24 09:48:01 -05:00
.B \- U in|cm|px
2007-04-06 10:27:03 -04:00
Specify the type of units to apply to dimensions for margins and
crop regions for input and output images. Inches or centimeters
are converted to pixels using the resolution unit specified in the
2007-02-24 09:48:01 -05:00
TIFF file (which defaults to inches if not specified in the IFD).
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- m #,#,#,#
2007-04-06 10:27:03 -04:00
Specify margins to be removed from the input image. The order must
be top, left, bottom, right with only commas separating the elements
of the list. Margins are scaled according to the current units and
removed before any other extractions are computed. Captial M was in use.
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- X #
2008-05-23 20:18:55 -04:00
Set the horizontal (X\- axis) dimension of a region to extract relative to
2007-04-06 10:27:03 -04:00
the specified origin reference. If the origin is the top or bottom
edge, the X axis value will be assumed to start at the left edge.
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- Y #
2008-05-23 20:18:55 -04:00
Set the vertical (Y\- axis) dimension of a region to extract relative to
2007-04-06 10:27:03 -04:00
the specified origin reference. If the origin is the left or right
edge, the Y axis value will be assumed to start at the top.
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- Z #:#,#:#
2007-04-06 10:27:03 -04:00
Specify zones of the image designated as position X of Y equal sized portions
measured from the reference edge, eg 1:3 would be first third of the
image starting from the reference edge minus any margins specified
for the confining edges. Multiple zones can be specified as a comma
separated list but they must reference the same edge. To extract the
top quarter and the bottom third of an image you would use
2007-02-24 09:48:01 -05:00
.B \- Z 1 :4,3:3.
2008-05-23 20:18:55 -04:00
.TP
.B \- z x1,y1,x2,y2: ... :xN,yN,xN+1,yN+1
Specify a series of coordinates to define regions for processing and exporting.
The coordinates represent the top left and lower right corners of each region
in the current units, eg inch, cm, or pixels. Pixels are counted from one to
width or height and inches or cm are calculated from image resolution data.
Each colon delimited series of four values represents the horizontal and vertical
offsets from the top and left edges of the image, regardless of the edge specified
with the \- E option. The first and third values represent the horizontal offsets of
the corner points from the left edge while the second and fourth values represent
the vertical offsets from the top edge.
.TP
2007-02-24 09:48:01 -05:00
.B \- F horiz|vert
2007-04-06 10:27:03 -04:00
Flip, ie mirror, the image or extracted region horizontally or vertically.
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- R 90 |180|270
2007-04-06 10:27:03 -04:00
Rotate the image or extracted region 90, 180, or 270 degrees clockwise.
2008-05-23 20:18:55 -04:00
.TP
.B \\ -I [black|white|data|both]
Invert color space, eg dark to light for bilevel and grayscale images.
This can be used to modify negative images to positive or to correct
images that have the PHOTOMETRIC_INTERPRETATIN tag set incorrectly.
If the value is black or white, the PHOTOMETRIC_INTERPRETATION tag is set to
MinIsBlack or MinIsWhite, without altering the image data. If the argument
is data or both, the data values of the image are modified. Specifying both
inverts the data and the PHOTOMETRIC_INTERPRETATION tag, whereas using data
inverts the data but not the PHOTOMETRIC_INTERPRETATION tag.
No support for color images.
.TP
2007-04-06 10:27:03 -04:00
.B \- H #
Set the horizontal resolution of output images to #
expressed in the current units.
2008-05-23 20:18:55 -04:00
.TP
2007-04-06 10:27:03 -04:00
.B \- V #
Set the vertical resolution of the output images to #
expressed in the current units.
2008-05-23 20:18:55 -04:00
.TP
2007-04-06 10:27:03 -04:00
.B \- J #
Set the horizontal margin of an output page size to #
expressed in the current units.
2008-05-23 20:18:55 -04:00
.TP
2007-04-06 10:27:03 -04:00
.B \- K #
Set the vertical margin of an output page size to #
expressed in the current units.
2008-05-23 20:18:55 -04:00
.TP
2007-04-06 10:27:03 -04:00
.B \- O portrait|landscape|auto
Set the output orientation of the pages or sections.
Auto will use the arrangement that requires the fewest pages.
2008-05-23 20:18:55 -04:00
.TP
2007-04-06 10:27:03 -04:00
.B \- S cols:rows
Divide each image into cols across and rows down equal sections.
2008-05-23 20:18:55 -04:00
.TP
2007-04-06 10:27:03 -04:00
.B \- P page
Format the output images to fit on page size paper. Use
2008-05-23 20:18:55 -04:00
\- P list to show the supported page sizes and dimensions.
.TP
2007-02-24 09:48:01 -05:00
.B \- B
2008-05-23 20:18:55 -04:00
Force output to be written with Big\- Endian byte order.
2007-04-06 10:27:03 -04:00
This option only has an effect when the output file is created or
overwritten and not when it is appended to.
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- C
2007-04-06 10:27:03 -04:00
Suppress the use of ``strip chopping'' when reading images
that have a single strip/tile of uncompressed data.
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- c
Specify the compression to use for data written to the output file:
.B none
for no compression,
.B packbits
for PackBits compression,
.B lzw
2008-05-23 20:18:55 -04:00
for Lempel\- Ziv & Welch compression,
2007-02-24 09:48:01 -05:00
.B jpeg
for baseline JPEG compression,
.B zip
for Deflate compression,
.B g3
for CCITT Group 3 (T.4) compression,
and
.B g4
for CCITT Group 4 (T.6) compression.
By default
.I tiffcrop
will compress data according to the value of the
.I Compression
tag found in the source file.
2008-05-23 20:18:55 -04:00
.IP
2007-02-24 09:48:01 -05:00
The
.SM CCITT
Group 3 and Group 4 compression algorithms can only
2007-04-06 10:27:03 -04:00
be used with bilevel data.
2008-05-23 20:18:55 -04:00
.IP
2007-02-24 09:48:01 -05:00
Group 3 compression can be specified together with several
2008-05-23 20:18:55 -04:00
T.4\- specific options:
2007-02-24 09:48:01 -05:00
.B 1 d
2008-05-23 20:18:55 -04:00
for 1\- dimensional encoding,
2007-02-24 09:48:01 -05:00
.B 2 d
2008-05-23 20:18:55 -04:00
for 2\- dimensional encoding,
2007-02-24 09:48:01 -05:00
and
.B fill
2008-05-23 20:18:55 -04:00
to force each encoded scanline to be zero\- filled so that the
2007-02-24 09:48:01 -05:00
terminating EOL code lies on a byte boundary.
2008-05-23 20:18:55 -04:00
Group 3\- specific options are specified by appending a ``:''\- separated
2007-02-24 09:48:01 -05:00
list to the ``g3'' option; e.g.
.B "\-c g3:2d:fill"
2008-05-23 20:18:55 -04:00
to get 2D\- encoded data with byte\- aligned EOL codes.
.IP
2007-02-24 09:48:01 -05:00
.SM LZW
compression can be specified together with a
.I predictor
value.
A predictor value of 2 causes
each scanline of the output image to undergo horizontal
differencing before it is encoded; a value
of 1 forces each scanline to be encoded without differencing.
2008-05-23 20:18:55 -04:00
LZW\- specific options are specified by appending a ``:''\- separated
2007-02-24 09:48:01 -05:00
list to the ``lzw'' option; e.g.
.B "\-c lzw:2"
for
.SM LZW
compression with horizontal differencing.
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- f
Specify the bit fill order to use in writing output data.
By default,
.I tiffcrop
will create a new file with the same fill order as the original.
Specifying
.B "\-f lsb2msb"
will force data to be written with the FillOrder tag set to
.SM LSB2MSB,
while
.B "\-f msb2lsb"
will force data to be written with the FillOrder tag set to
.SM MSB2LSB.
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- i
2008-05-23 20:18:55 -04:00
Ignore non\- fatal read errors and continue processing of the input file.
.TP
2007-02-24 09:48:01 -05:00
.B \- l
Specify the length of a tile (in pixels).
.I tiffcrop
attempts to set the tile dimensions so
that no more than 8 kilobytes of data appear in a tile.
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- L
2008-05-23 20:18:55 -04:00
Force output to be written with Little\- Endian byte order.
2007-02-24 09:48:01 -05:00
This option only has an effect when the output file is created or
overwritten and not when it is appended to.
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- M
2008-05-23 20:18:55 -04:00
Suppress the use of memory\- mapped files when reading images.
.TP
2007-02-24 09:48:01 -05:00
.B \- p
Specify the planar configuration to use in writing image data
2008-05-23 20:18:55 -04:00
that has more than one 8\- bit sample per pixel.
2007-02-24 09:48:01 -05:00
By default,
.I tiffcrop
will create a new file with the same planar configuration as
the original.
Specifying
.B "\-p contig"
2008-05-23 20:18:55 -04:00
will force data to be written with multi\- sample data packed
2007-02-24 09:48:01 -05:00
together, while
.B "\-p separate"
will force samples to be written in separate planes.
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- r
Specify the number of rows (scanlines) in each strip of data
written to the output file.
By default (or when value
.B 0
is specified),
.I tiffcrop
2007-04-06 10:27:03 -04:00
attempts to set the rows/strip that no more than 8 kilobytes of
data appear in a strip. If you specify the special value
2008-05-23 20:18:55 -04:00
.B \- 1
2007-02-24 09:48:01 -05:00
it will results in infinite number of the rows per strip. The entire image
will be the one strip in that case.
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- s
Force the output file to be written with data organized in strips
(rather than tiles).
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- t
Force the output file to be written with data organized in tiles
(rather than strips).
2008-05-23 20:18:55 -04:00
.TP
2007-02-24 09:48:01 -05:00
.B \- w
Specify the width of a tile (in pixels).
.I tiffcrop
attempts to set the tile dimensions so
that no more than 8 kilobytes of data appear in a tile.
.I tiffcrop
attempts to set the tile dimensions so
that no more than 8 kilobytes of data appear in a tile.
2008-05-23 20:18:55 -04:00
.SH "EXAMPLES"
2007-02-24 09:48:01 -05:00
The following concatenates two files and writes the result using
.SM LZW
encoding:
.RS
2008-05-23 20:18:55 -04:00
.nf
tiffcrop \- c lzw a.tif b.tif result.tif
.fi
2007-02-24 09:48:01 -05:00
.RE
2008-05-23 20:18:55 -04:00
.PP
To convert a G3 1d\- encoded
2007-02-24 09:48:01 -05:00
.SM TIFF
2008-05-23 20:18:55 -04:00
to a single strip of G4\- encoded data the following might be used:
2007-02-24 09:48:01 -05:00
.RS
2008-05-23 20:18:55 -04:00
.nf
tiffcrop \- c g4 \- r 10000 g3.tif g4.tif
.fi
2007-02-24 09:48:01 -05:00
.RE
(1000 is just a number that is larger than the number of rows in
the source file.)
2008-05-23 20:18:55 -04:00
To extract a selected set of images from a multi\- image TIFF file
use the \- N option described above. Thus, to copy the 1st and 3rd
2007-02-24 09:48:01 -05:00
images of image file "album.tif" to "result.tif":
.RS
2008-05-23 20:18:55 -04:00
.nf
tiffcrop \- N 1,3 album.tif result.tif
.fi
2007-02-24 09:48:01 -05:00
.RE
2008-05-23 20:18:55 -04:00
.PP
2007-04-06 10:27:03 -04:00
Invert a bilevel image scan of a microfilmed document and crop off margins of
2008-05-23 20:18:55 -04:00
0.25 inches on the left and right, 0.5 inch on the top, and 0.75 inch on the
2007-04-06 10:27:03 -04:00
bottom. From the remaining portion of the image, select the second and third
quarters, ie, one half of the area left from the center to each margin.
2007-02-24 09:48:01 -05:00
.RS
2008-05-23 20:18:55 -04:00
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
.fi
2007-02-24 09:48:01 -05:00
.RE
2008-05-23 20:18:55 -04:00
.PP
2007-04-06 10:27:03 -04:00
Extract only the final image of a large Architectural E sized
multipage TIFF file and rotate it 90 degrees clockwise while
reformatting the output to fit on tabloid sized sheets with one
quarter of an inch on each side:
.RS
2008-05-23 20:18:55 -04:00
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
.fi
2007-04-06 10:27:03 -04:00
.RE
The output images will have a specified resolution of 300 dpi in both
directions. The orientation of each page will be determined by whichever
choice requires the fewest pages. To specify a specific orientation, use
the portrait or landscape option.
2008-05-23 20:18:55 -04:00
.fi
.RE
.PP
Extract two regions 2048 pixels wide by 2048 pixels high from each page of
a multi\- page input file and write each region to a separate output file.
.RS
tiffcrop \- U px \- z 1,1,2048,2048:1,2049,2048,4097 \- e separate CheckScans.tiff Check.tiff
.fi
.RE
The output file names will use the stem Check with a numeric suffix which is
incremented for each region of each image, eg Check\- 001.tiff, Check\- 002.tiff ...
Check\- NNN.tiff. To produce a unique file for each page of the input image
with one new image for each region of the input image on that page, change
the export option to \- e multiple.
.SH "NOTES"
.PP
Not all options work with all
.I TIFF
data types. In general, bilevel, grayscale, palette and RGB(A) data in 8 or 16 bit
formats should work, but I have limited access to sample images in uncommon formats
or formats with other color models.
Floating point data types will probably not be handled correctly by functions that
manipulate individual images. Tiffcrop is derived
from code in
.I tiffcp
with extensive modifications and additions to support the selection of input images
and regions and the exporting of them to one or more output files in various
groupings. The image manipulation routines are entirely new and additional ones may
be added in the future.
.PP
.I Tiffcrop
was designed to handle large files containing many moderate sized images with memory
usage that is independent of the number of images in the file. In addition to the
memory required by the input and output buffers associated with
.I LIBTIFF
one or more buffers at least as large as the largest image to be read will be
required. The design favors large volume document processing uses over scientific or graphical manipulation of large datasets as might be found in research scenarios.
2007-02-24 09:48:01 -05:00
.SH "SEE ALSO"
.BR pal2rgb (1),
.BR tiffinfo (1),
.BR tiffcmp (1),
.BR tiffcp (1),
.BR tiffmedian (1),
.BR tiffsplit (1),
.BR libtiff (3TIFF)
2008-05-23 20:18:55 -04:00
.PP
2007-02-24 09:48:01 -05:00
Libtiff library home page:
.BR http://www.remotesensing.org/libtiff/
2007-04-06 10:27:03 -04:00