TIFF Utilities ============== These utilities are part of the LIBTIFF and LIBGEOTIFF libraries which are provided as freeware. Below is a description of each of the utilities provided. --------------------------------------------------------------------------------- tiffinfo.exe usage : tiffinfo myfile.tif Display information about TIFF files. --------------------------------------------------------------------------------- tiffdump.exe usage : tiffdump myfile.tif Display the verbatim contents of the TIFF directory in a file (it's very useful for debugging bogus files that you may get from someone that claims they support TIFF) You must really know TIFF file tags for this info to be useful. -------------------------------------------------------------------------------- listgeo.exe usage : listgeo myfile.tif The program listgeo takes a GeoTIFF file as input and dumps to the standard output a GeoTIFF "metadata" file, which is human readable, and may also be used as input to other programs such as geotifcp.exe GeoTIFF Metadata Format: For the formalist junkies, we will define a GeoTIFF metadata format in an unambiguous fashion, and follow that by a concrete example. The metadata format is defined as follows (all strings not placed between are string literals, case-sensitive, and any entry followed by "*" or "*" indicates multiple entries): = + + = + Geotiff_Information: + = + End_Of_Geotiff. + = + + = + = Version: + + + = = Revision: + + + + + = = = + * + = + Tagged_Information: + = + End_Of_Tags. + = + * = + + + + = "(" + + + + ")" = = = + * + = + * + = + Keyed_Information: + = + End_Of_Keys. + = + = + + + + = "(" + + + + ")" = ( | | ) = ( | ) = + + = All symbolic tag names defined in GeoTIFF spec. = All symbolic key names defined in GeoTIFF spec. = All symbolic value names defined in GeoTIFF spec. = (Short | Ascii | Double) And for the pedantic: = ( | )* = = = ( |e) = ( |+|-) = (0|1|2|3|4|5|6|7|8|9)* ... Example (default output of listgeo): Geotiff_Information: Version: 1 Key_Revision: 0.2 Tagged_Information: ModelTiepointTag (2,3): 0 0 0 130 32 0 ModelPixelScaleTag (1,3): 1 1 0 End_Of_Tags. Keyed_Information: GTModelTypeGeoKey (Short,1): ModelTypeGeographic GTRasterTypeGeoKey (Short,1): RasterPixelIsArea GTCitationGeoKey (Ascii,16): "Just An Example" GeographicTypeGeoKey (Short,1): User-Defined GeogCitationGeoKey (Ascii,24): "Everest Ellipsoid Used." GeogGeodeticDatumGeoKey (Short,1): User-Defined GeogLinearUnitsGeoKey (Short,1): Linear_Meter GeogAngularUnitsGeoKey (Short,1): Angular_Degree GeogEllipsoidGeoKey (Short,1): Ellipse_Everest_1830_1967_Definition GeogSemiMajorAxisGeoKey (Double,1): 6377298.556 GeogInvFlatteningGeoKey (Double,1): 300.8017 End_Of_Keys. End_Of_Geotiff. -------------------------------------------------------------------------------- gtifcp.bat usage : gtifcp infile.tif outfile.tif Calls the geotifcp.exe program (described below) but passes to it the parameters which will write out the tif file to a new name in a TIFF format better suited for use by OziExplorer and also Fugawi. CAUTION - Note that no georeference data is copied, however it is possible using the geotifcp program to insert georeference data extracted by the listgeo.exe program (above). Also note that there is no need to use this program on USGS DRG maps as these are already in the best format (they also usually contain georeference data which will be lost). This is a listing of the gtifcp.bat file @echo off rem standard options to produce rem a TIFF file with rem rem -s use strips rem -r 1 one row per strip rem -c packbits packbits compression rem geotifcp -s -r 1 -c packbits %1 %2 rem ------------------------------------------------------------------------------- geotifcp.exe Copy a TIFF file and install GeoTIFF info from a metadata file. Usage : geotifcp [options] -g metadata input.tif output.tif The program geotifcp is identical in function to the LIBTIFF program "tiffcp", with the additional feature that if the "-g " option is used the GeoTIFF information from the file will be installed into the output file. If the "-g" option is not used, the opposite effect occurs: all GeoTIFF information is filtered out of the input file before being written to the new output file. "geotifcp" inherits all the other file-transformation capabilities of the tiffcp program; for help on the additional parameters give the command: geotifcp -h Options and Parameters usage: geotifcp [options] input... output where options are: -g file install GeoTIFF metadata from -a append to output instead of overwriting -o offset set initial directory offset -p contig pack samples contiguously (e.g. RGBRGB...) -p separate store samples separately (e.g. RRR...GGG...BBB...) -s write output in strips -t write output in tiles -i ignore read errors -r # make each strip have no more than # rows -w # set output tile width (pixels) -l # set output tile length (pixels) -f lsb2msb force lsb-to-msb FillOrder for output -f msb2lsb force msb-to-lsb FillOrder for output -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding -c zip[:opts] compress output with deflate encoding -c jpeg[:opts]compress output with JPEG encoding -c packbits compress output with packbits encoding -c g3[:opts] compress output with CCITT Group 3 encoding -c g4 compress output with CCITT Group 4 encoding -c none use no compression algorithm on output Group 3 options: 1d use default CCITT Group 3 1D-encoding 2d use optional CCITT Group 3 2D-encoding fill byte-align EOL codes For example, -c g3:2d:fill to get G3-2D-encoded data with byte-aligned EOLs JPEG options: Not supported # set compression quality level (0-100, default 75) r output color image as RGB rather than YCbCr For example, -c jpeg:r:50 to get JPEG-encoded RGB data with 50% comp. quality LZW and deflate options: # set predictor value For example, -c lzw:2 to get LZW-encoded data with horizontal differencing ---------------------------------------------------------------------------------