2006.12.07 18:21 "[Tiff] New utility for contrib directory", by Richard Nolde

Tiffcrop extends tiffcp with functions to crop, rotate, mirror, and (for grayscale and bilevel only invert the color values) of images modifying the data as well as the IFD itself. Only the new options are listed below. I also have some new test images with 2, 3, and 4 bit depths and JBIG compression.

The source code is attached to the Bugzilla entry 1383. I have successfully run the new utility under AIX 5.3 and Fedora Core 4/5. It is built against the LIBTIFF 3.8.2 release. Please forward any questions or bug reports to me with as much specific detail as possible. The TIFF IFD handling is taken from tiffcp and tiffcrop will behave exactly like tiffcp if none of the options below are used.

-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.

-U units [in, cm, px ] inches, centimeters or pixels
-X # horizontal dimension of region to extract expressed in
current units
-Y # vertical dimension of region to extract expressed in current

-E t|l|r|b edge to use as origin for width and length of crop region -m #,#,#,# margins from edges for selection: top, left, bottom, right separated by commas

-Z #:#,#:# zones of the image designated as position X of Y,
             eg 1:3 would be first of three equal portions measured from
reference edge
-R # [90,180,or 270] degrees clockwise rotation of image or
extracted region
-F h|v flip ie mirror image or extracted region horizontally or
-I invert the color space, eg dark to light for bilevel and
grayscale images