[Gdal-dev] Resampling With GDAL

Mike Richardson mike at scenomics.com
Fri Apr 20 03:53:36 EDT 2007


Not sure if this has been covered yet but I read a thread recently that discussed image resampling with GDAL. The results with one resampling pass were not quite satisfactory ... 

At any rate, here is technique you can use to create smooth, anti-aliased resampled images with GDAL. It's not perfect and it is a bit more work but it does generate good results.

===============================================================
Sample Batch File
===============================================================

gdalwarp -of GTiff -ts 900 900 input_filename.tif -rcs resampled_01.tif
gdalwarp -of GTiff -ts 800 800 resampled_01.tif -rcs resampled_02.tif
gdalwarp -of GTiff -ts 700 700 resampled_02.tif -rcs resampled_03.tif
gdalwarp -of GTiff -ts 600 600 resampled_03.tif -rcs resampled_04.tif
gdalwarp -of GTiff -ts 500 500 resampled_04.tif -rcs resampled_05.tif
gdalwarp -of GTiff -ts 400 400 resampled_05.tif -rcs resampled_06.tif
gdalwarp -of GTiff -ts 300 300 resampled_06.tif -rcs resampled_07.tif
gdalwarp -of GTiff -ts 200 200 resampled_07.tif -rcs resampled_08.tif
gdalwarp -of GTiff -ts 128 128 resampled_08.tif -rcs resampled_09.tif


gdal_translate -of BMP resampled_09.tif resampled_10.bmp

del resampled_01.tif
del resampled_02.tif
del resampled_03.tif
del resampled_04.tif
del resampled_05.tif
del resampled_06.tif
del resampled_07.tif
del resampled_08.tif
del resampled_09.tif

===============================================================

This will generate a nicely smoothed image by using successive passes. Please forgive the redundancy if this has been suggested already.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070420/936fa667/attachment.html


More information about the Gdal-dev mailing list