A gigapan

Thursday, October 14, 2010

GDAL Utilities for Gigapan Processing

I've been using the 'Geodata Abstraction Library' utilities to process gigapan images. There is some philosophy here I could go off on, but I just want to capture some useful command lines.

The easiest way to get _lots_ of nifty spatial tools is to down load "FWTools: Open Source GIS Binary Kit for Windows and Linux"

GDAL includes useful command line tools for manipulating spatial data. And we can treat gigapans as spatial data.

Shrink a large image to 10% of its' original size:
gdal_translate -outsize 10% 10% infile.tif outfile.tif

RGBA Tiff images can be split into component parts.  This is an interesting effect:
gdal_translate -b 1  -of JPEG -outsize 10% 10% maia_hands.tif m_b1.jpg
gdal_translate -b 2  -of JPEG -outsize 10% 10% maia_hands.tif m_b2.jpg
gdal_translate -b 3  -of JPEG -outsize 10% 10% maia_hands.tif m_b3.jpg

Merge two bands, with output greyscaled:
gdal_translate -b 1 -b 2  -outsize 10% 10% maia_hands.tif m_b12.tif

Crop an image
gdal_translate -srcwin 3400 2700 12500 8500  maia_hands.tif m_subwin.tif
-srcwin xoffset yoffset xsize ysize
offset where the top left is 0,0.

No comments:

Post a Comment