libtiff: Updated to reflect recent changes in tiffcrop.

From 377d5d30e93eb070b55a713bf822caff19905c9d Mon Sep 17 00:00:00 2001
From: Andrey Kiselev <[EMAIL REDACTED]>
Date: Fri, 6 Apr 2007 14:26:08 +0000
Subject: [PATCH] Updated to reflect recent changes in tiffcrop.

---
 man/tiffcrop.1 | 219 ++++++++++++++++++++++++++++++++-----------------
 1 file changed, 143 insertions(+), 76 deletions(-)

diff --git a/man/tiffcrop.1 b/man/tiffcrop.1
index cc2a076c..29bacb21 100644
--- a/man/tiffcrop.1
+++ b/man/tiffcrop.1
@@ -1,5 +1,7 @@
-.\" $Id: tiffcrop.1,v 1.1 2007-02-24 14:50:13 dron Exp $
-.\" tiffcrop -- a port of tiffcp extended to include cropping of selections
+.\" $Id: tiffcrop.1,v 1.1.2.1 2007-04-06 14:26:08 dron Exp $
+.\" tiffcrop -- a port of tiffcp.c extended to include cropping of selections
+.\"
+.\" Original code:
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -23,31 +25,40 @@
 .\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
 .\" OF THIS SOFTWARE.
 .\"
-.\" Richard Nolde  11/2006 Add support for the options below to extract 
+.\" Richard Nolde Updated 3/2007 Add support for the options below to extract 
 .\" 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
 .\"
 .\" Options: 
 .\" -U units    [in, cm, px ] inches, centimeters or pixels
+.\" -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
 .\" -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
-.\" -M #,#,#,#  margins from edges for selection: top, left, bottom, right (commas separated)
-.\" -Z #:#,#:#  up to six zones of the image designated as zone X of Y, 
-.\"             e.g. 1:3 would be first of three equal portions measured from reference edge
+.\" -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, 
+.\"             eg 1:3 would be first of three equal portions measured from reference edge
 .\" -N odd|even|#,#-#,#|last         sequences and ranges of images within file to process
 .\"             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
 .\" -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 
-.\" -I          invert the colormap, black to white, for bi-level and grayscale images
+.\" -I          invert the colormap, black to white, for bilevel and grayscale images
 .\"
 .if n .po 0
-.TH TIFFCROP 1 "February 24, 2007" "libtiff"
+.TH TIFFCROP 1 "April 06, 2007" "libtiff"
 .SH NAME
-tiffcrop \- copy (and possibly convert and crop or process) a
+tiffcrop \- copy, convert, crop, extract, or process a
 .SM TIFF
 file
 .SH SYNOPSIS
@@ -58,106 +69,150 @@ file
 .I "src1.tif ... srcN.tif dst.tif"
 .SH DESCRIPTION
 .I tiffcrop
-combines one or more files created according to the Tag Image File Format,
-Revision 6.0 into a single
+combines one or more files created according
+to the Tag Image File Format, Revision 6.0
+into a single
 .SM TIFF
-file. The output file may be compressed using a different algorithm than the
-input files.
+file.
+The output file may be compressed using a different
+algorithm than the input files.
 .I tiffcrop
-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.
+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 
+smaller sections.
+.PP
+Functions are applied to the input image in the following order:
+.RS
+.nf
+cropping, fixed area extraction, zones, inversion, mirroring, rotation.
+.fi
+.RE
+.TP
+Functions are applied to the output image in the following order:
+.RS
+output resolution, output margins, rows and columns 
+.B or
+page size divisions, orientation options, strip, tile, byte order, 
+and compression options.
+.fi
+.RE
 .PP
 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.
+Options can be used to force the resultant image to be written as strips 
+or tiles of data, respectively.
 .PP
 .I tiffcrop
-can be used to reorganize the storage characteristics of data in a file, and
-it will alter or convert the image data content as specified at the same time,
-unlike tiffcp.
+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. 
 .PP
-.I tiffcrop
-will behave exactly like tiffcp if none of the new options are specified.
 .SH OPTIONS
 .TP
 .B \-N odd|even|#,#-#,#|last
-sequences and ranges of images within file to process. The words
+Specify one or more series or range(s) of images within file to process.
+The words
 .B odd
 or
 .B even
 may be used to specify all odd or even numbered images. The word
 .B 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. Ranges of images may be
-specified with a dash and multiple sets can be indicated by joining them in a
-comma-separated list. e.g.. use
+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
+can be indicated by joining them in a comma-separated list. eg. use
 .B \-N 1,5-7,last 
 to process the 1st, 5th through 7th, and final image in the file.
 .TP
 .B \-E top|bottom|left|right
-use the top, bottom, left, or right edge as origin reference for width and
-length of crop regions. May be abbreviated to first letter.
+Specify the top, bottom, left, or right edge as the reference from
+which to calcuate the width and length of crop regions or sequence
+of postions for zones. May be abbreviated to first letter.
 .TP
 .B \-U in|cm|px
-units to apply to dimensions for margins and crop regions. Inches or
-centimeters are converted to pixels using the resolution unit specified in the
+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 
 TIFF file (which defaults to inches if not specified in the IFD).
 .TP
 .B \-m #,#,#,#
-margins to be removed from the 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. Capital M was in use.
+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.
 .TP
 .B \-X #
-horizontal (X-axis) dimension of a region to extract relative to 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.
+Set the horizontal (X-axis) dimension of a region to extract relative to 
+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.
 .TP
 .B \-Y #
-vertical (Y-axis) dimension of a region to extract relative to 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.
+Set the vertical (Y-axis) dimension of a region to extract relative to
+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.
 .TP
 .B \-Z  #:#,#:#  
-zones of the image designated as position X of Y equal sized portions measured
-from the reference edge,  e.g. 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 
+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 
 .B \-Z 1:4,3:3.
 .TP
 .B \-F horiz|vert
-flip, i.e. mirror, the image or extracted region horizontally or vertically.
+Flip, ie mirror, the image or extracted region horizontally or vertically.
 .TP
 .B \-R 90|180|270
-rotate the image or extracted region 90, 180, or 270 degrees clockwise.
+Rotate the image or extracted region 90, 180, or 270 degrees clockwise.
 .TP
 .B \-I
-invert the colorspace values for grayscale and bi-level images. This 
-would be used to correct negative images that have incorrect PHOTOMETRIC
+Invert the colorspace values for grayscale and bilevel images. This 
+would be used to correct negative images that have incorrect PHOTMETRIC
 INTERPRETATION tags. No support for color images.
 .TP
-.BI \-b " image"
-subtract the following monochrome image from all others processed.  This can
-be used to remove a noise bias from a set of images.  This bias image is
-typically an image of noise the camera saw with its shutter closed. Bias image
-support is not available with options for cropping, rotating, or inverting the
-image.
+.B \-H #
+Set the horizontal resolution of output images to #
+expressed in the current units.
+.TP
+.B \-V #
+Set the vertical resolution of the output images to #
+expressed in the current units.
+.TP
+.B \-J #
+Set the horizontal margin of an output page size to #
+expressed in the current units.
+.TP
+.B \-K #
+Set the vertical margin of an output page size to # 
+expressed in the current units.
+.TP
+.B \-O portrait|landscape|auto
+Set the output orientation of the pages or sections.
+Auto will use the arrangement that requires the fewest pages.
+.TP
+.B \-S cols:rows
+Divide each image into cols across and rows down equal sections.
+.TP
+.B \-P page
+Format the output images to fit on page size paper. Use
+-P list to show the supported page sizes and dimensions.
 .TP
 .B \-B
-Force output to be written with Big-Endian byte order. This option only has an
-effect when the output file is created or overwritten and not when it is
-appended to.
+Force output to be written with Big-Endian byte order.
+This option only has an effect when the output file is created or
+overwritten and not when it is appended to.
 .TP
 .B \-C
-Suppress the use of ``strip chopping'' when reading images that have a single
-strip/tile of uncompressed data.
+Suppress the use of ``strip chopping'' when reading images
+that have a single strip/tile of uncompressed data.
 .TP
 .B \-c
 Specify the compression to use for data written to the output file:
@@ -185,7 +240,7 @@ tag found in the source file.
 The
 .SM CCITT
 Group 3 and Group 4 compression algorithms can only
-be used with bi-level data.
+be used with bilevel data.
 .IP
 Group 3 compression can be specified together with several
 T.4-specific options:
@@ -250,7 +305,7 @@ Suppress the use of memory-mapped files when reading images.
 .TP
 .B \-p
 Specify the planar configuration to use in writing image data
-that has one 8-bit sample per pixel.
+that has more than one 8-bit sample per pixel.
 By default,
 .I tiffcrop
 will create a new file with the same planar configuration as
@@ -269,9 +324,8 @@ By default (or when value
 .B 0
 is specified),
 .I tiffcrop
-attempts to set the rows/strip
-that no more than 8 kilobytes of data appear in a strip. If you specify
-special value
+attempts to set the rows/strip that no more than 8 kilobytes of 
+data appear in a strip. If you specify the special value
 .B -1
 it will results in infinite number of the rows per strip. The entire image
 will be the one strip in that case.
@@ -283,8 +337,6 @@ Force the output file to be written with data organized in strips
 .B \-t
 Force the output file to be written with data organized in tiles
 (rather than strips).
-options can be used to force the resultant image to be written
-as strips or tiles of data, respectively.
 .TP
 .B \-w
 Specify the width of a tile (in pixels).
@@ -329,17 +381,31 @@ images of image file "album.tif" to "result.tif":
 tiffcrop -N 1,3 album.tif result.tif
 .fi
 .RE
-
-Given file "CCD.tif" whose first image is a noise bias
-followed by images which include that bias,
-subtract the noise from all those images following it
-(while decompressing) with the command:
+.PP
+Invert a bilevel image scan of a microfilmed document and crop off margins of
+0.25 inches on the left and right, 0.5 inch on the top, nad 0.75 inch on the
+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. 
 .RS
 .nf
-tiffcrop -c none -b CCD.tif CCD.tif -d 2 result.tif
+tiffcrop -U in -m 0.5,0.25,0.75,0.25 -E left -Z 2:4,3:4 -I MicrofilmNegative.tif MicrofilmPostiveCenter.tif
 .fi
 .RE
-
+.PP
+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
+.nf
+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
+.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.
+.PP
 .SH "SEE ALSO"
 .BR pal2rgb (1),
 .BR tiffinfo (1),
@@ -351,3 +417,4 @@ tiffcrop -c none -b CCD.tif CCD.tif -d 2 result.tif
 .PP
 Libtiff library home page:
 .BR http://www.remotesensing.org/libtiff/
+