wiki:UserDocs/GeoTiff

Version 1 (modified by maphew, 16 years ago) ( diff )

added optimal lzw compression

The GeoTIFF file format

GeoTIFF is the most versatile raster format for geo-referenced imagery and is the default for all gdal utilities.

The official GDAL documentation for the geotiff file format is http://www.gdal.org/frmt_gtiff.html.

  1. Optimal LZW Compression

Optimal LZW Compression

Photoshop users will note that it achieves noticeably smaller files on the same data than does gdal (using the defaults). One can improve gdal compression, though still not match Photoshop, by using the -co predictor=[1/2/3] option.

gdal_translate -co compress=lzw -co predictor=2 inimage.tif outimage.tif

The default is 1 (no predictor), 2 is horizontal differencing and 3 is floating point prediction. If your image is not floating point you will not get any effect from predictor 3. For integer data (e.g. byte) choose predictor 2.

To see what compression scheme and predictor Photoshop or whatever has used on a tiff file, use the tiffinfo utility.

References 1, 2

Note: See TracWiki for help on using the wiki.