Creating LZW compressed TIFF files outside of a Geodatabase

generating a compressed GeoTIFF for ArcGIS that is outside of a Geodatabase

Software: ArcGIS 9.2, Adobe Photoshop

Question

Experimenting with raster compression formats with a scan of a ~D sized paper map (300 dpi) I found that after georeferencing (using Lat/Long) I could create a 18mb JPG file together with its JGW worldfile at about 80% JPG compression. How large would this file be in a non-lossy format that is widely readable by non-GIS users?

Formats

As JPG is a lossy format I began to experiment with standalone (non-geodatabase) raster formats that are widely readable by non-GIS users. JPG2000 is a more optimized solution than the older JPEG but the filesizes were actually larger for some reason. PNG does not seem to be well supported by GIS software yet. Other common GIS formats like SID (lossy) and IMG (non-lossy) are not easily readable outside of a GIS environment.

TIF with LZW

A non-lossy but compressed format like TIF - LZW or LZ77 would be ideal for imagery, however ArcGIS only generates compressed TIF files when going into a Geodatabase.

It turns out that you can create a TIF in ArcCatalog 9.2 (CopyRaster command) and the 18mb JPG became a 197 mb TIF file (uncompressed). The TIF file can be opened and saved in Photoshop with LZW compression and the resulting file, in this case, was 123 mb (62% reduction). This step can be batched with a Photoshop droplet It is important to note that with ArcGIS 9.2 a TIF worldfile (TFW) is no longer created. However, it seems that the *.aux.xml file stores this information and it will maintain the position of your TIF files even after being compressed in Photoshop.

These two utilities are useful for working with TIF Worldfiles
GeoTIFF_Examine 1.02
TiffWorldfile Creator (batchable).


Matt Wilkie writes

The compression used in geodatabase is LZ77 (same as PNG) or JPEG/JP2 which have no license restrictions. LZW compression, used in TIFF and GIF and probably elsewhere used to be a by-license-only feature but the patent expired a little while ago and there is no longer any restriction.

Photoshop (and the freeware xnview) work well for adding compression to tiffs but any embedded georeferencing and ground control points will be lost.

For 3rd party utilities to compress geotiffs while maintaining the georeferencing I recommend gdal_translate from FWTools for command line use and QGIS for interactive use (which uses gdal under the hood).

http://fwtools.maptools.org/

http://qgis.org/

From ESRI-L Digest

Addendum: it's not possible to export compressed tiff with ArcGIS Desktop, but it can be done with ArcInfo Workstation, as has been the case for than a decade. To use LZW compression with Workstation you need to request a free keycode from ESRI[1]

[1] Article 2712
http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=27172
Thanks to Bob Heselton for reminding me.

Bob Carr from the USDA Forest Services shared a hack which enables compression ArcGIS Desktop. I've verified that it works for us, with the drawback that the compression type is hardcoded. The preference file is loaded on startup, so one must exit and restart all ArcGIS programs to utilize changes.

Enabling TIFF Compression in ArcGIS 9.0+:
Open "C:\Program Files\Common Files\ESRI\Raster\defaults\tiff.pdf" in a text editor and for each image type (1bit, 8bit, etc.) change from None to the desired type.

The attached TIFF Preference Definition File is set for LZW compression for 1-bit,8-bit, & Other band combinations, and increases JPEG compression quality from 75 to 85.

It turns out there is even an ESRI Knowledgebase Article, #28400, for
this:
http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=28400