# GTiff -- GeoTIFF File Format

Most forms of TIFF and GeoTIFF files are supported by GDAL for reading, and somewhat less varieties can be written.

Currently band types of Byte, UInt16, Int16, UInt32, Int32, Float32, Float64, CInt16, CInt32, CFloat32 and CFloat64 are supported for reading and writing. Paletted images will return palette information associated with the band. The compression formats listed below should be supported for reading as well.

As well, one bit files, and some other unusual formulations of GeoTIFF file, such as YCbCr color model files, are automatically translated into RGBA (red, green, blue, alpha) form, and treated as four eight bit bands.

## Georeferencing

Most GeoTIFF projections should be supported, with the caveat that in order to translate uncommon Projected, and Geographic coordinate systems into OGC WKT it is necessary to have the EPSG .csv files avalable. They must be found at the location pointed to by the GEOTIFF_CSV environment variable.

Georeferencing from GeoTIFF is supported in the form of one tiepoint and pixel size, a transformation matrix, or a list of GCPs.

If no georeferencing information is available in the TIFF file itself, GDAL will also check for, and use an ESRI world file with the extention .tfw, .tiffw or .wld, as well as a MapInfo .tab file (only control points used, Coordsys ignored).

## Creation Issues

GeoTIFF files can be created with any GDAL defined band type, including the complex types. Created files may have any number of bands. Files with exactly 3 bands will be given a photometric interpretation of RGB, files with exactly four bands will have a photometric interpretation of RGBA, while all other combinations will have a photometric interpretation of MIN_IS_WHITE. Files with pseudo-color tables, or GCPs can currently only be created when creating from an existing GDAL dataset with those objects (GDALDriver::CreateCopy()).

Creation Options:

- TFW=YES: Force the generation of an associated ESRI world file (.tfw).

- INTERLEAVE=[BAND,PIXEL]: By default TIFF files with band interleaving (PLANARCONFIG_SEPARATE in TIFF terminology) are created. These are slightly more efficient for some purposes, but some applications only support pixel interleaved TIFF files. In these cases pass INTERLEAVE=PIXEL to produce pixel interleaved TIFF files (PLANARCONFIG_CONTIG in TIFF terminology).

- TILED=YES: By default stripped TIFF files are created. This option can be used to force creation of tiled TIFF files.

- BLOCKXSIZE=n: Sets tile width, defaults to 256.

- BLOCKYSIZE=n: Set tile or strip height. Tile height defaults to 256, strip height defaults to a value such that one strip is 8K or less.

- COMPRESS=[JPEG/LZW/PACKBITS/DEFLATE/NONE]: Set the compression to use. JPEG should only be used with Byte data. LZW is normally unavailable. None is the default.

- PREDICTOR=[0/1/2]: Set the predictory for LZW or DEFLATE compression. The default is 0 (no predictory), 1 is horizontal differencing and 2 is floating point predictory.

- JPEG_QUALITY=[1-100]: Set the JPEG quality when using JPEG compression. A value of 100 is best quality (least compression), and 1 is worst quality (best compression). The default is 75.

- PROFILE=[GDALGeoTIFF/GeoTIFF/BASELINE]: Control what non-baseline tags are emitted by GDAL. With `GDALGeoTIFF` (the default) various GDAL custom tags may be written. With `GeoTIFF` only GeoTIFF tags will be added to the baseline. With `BASELINE` no GDAL or GeoTIFF tags will be written. BASELINE is occationally useful when writing files to be read by applications intolerant of unrecognised tags.

- PHOTOMETRIC=[MINISBLACK/MINISWHITE/RGB/CMYK/YCBCR/CIELAB/ICCLAB/ITULAB]: Set the photometric interpretation tag. Default is MINISBLACK, but if the input image has 3 or 4 bands of Byte type, then RGB will be selected. You can override default photometric using this option.

- ALPHA=YES: The first "extrasample" is marked as being alpha if there are any extra samples. This is necessary if you want to produce a greyscale TIFF file with an alpha band (for instance).

GeoTIFF supports internal creation of overviews (with gdaladdo for instance). See Also:

- GeoTIFF Information Page
- libtiff Page