[Gdal-dev] Resampling with gdalwarp

Mario Beauchamp starged at videotron.ca
Tue Mar 16 23:28:40 EST 2004


Hi Frank,

On Tue, 16 Mar 2004 18:58:27 -0500, Frank Warmerdam <warmerdam at pobox.com> wrote:

>> Is there something wrong with gdalwarp resampling algorithms? I have done some tests and got strange
>> results which I put here: http://pages.infinit.net/starged/gdal/resampling.html
>
>At the macro level (looking at a whole image) I would expect bilinear and
>cubic convolution to be hard to differentiate unless a great deal of
>resolution magnification is taking place.

I don't know much about resampling algorithms... all I know is to use bilinear when you reduce and
cubic when you enlarge. Is that correct?

Works like that in PSP anywhow, and in fact using "Cubic" when reducing does not work well.

>I looked at the images, and it does appear that there are some differences
>from the results in Paint Shop Pro, but it is impossible for me to tell
>what might be causing the differences.   If you can provide the input
>files, and arguments you used to process them, and the raw results from
>Paint Shop Pro I could try and compare.

Here's the raw PSP image http://pages.infinit.net/starged/gdal/test-psp.tif

The test image is 1779KB... and I don't think I have that much space left on my site so here's a
cropped version: http://pages.infinit.net/starged/gdal/test-gwarp.tif

Note that there is nothing special about that image. I chose it because it was a good example. I get
pretty much the same results with any image that has roads or railways (ie, they are jagged or
chopped).

I simply used: gdalwarp -tr 120 120 -rb
There is no special arguments for PSP, we simply select "Bilinear" in the resize image dialog. The
exact algorithm used is not documented.

Also, the OSSIM bilinear resampling looks about the same as the PSP image. But it has some other
problems so I chose not to include it.

>However, there isn't anything I do with jpeg files since the "corruption" of the data due to jpeg
>compression will in many ways dominate the effects of different resampling algorithms.

These are actually copies of the original images and I used "quality=95" when I converted to jpeg
and used 1% trim linear stretch to enhance. I can tell you there is no noticeable difference between
the jpegs and the tiffs at 1:1.

Thanks.

--
Mario B.
Mes images Landsat:
http://pages.infinit.net/starged/landsat/index.html



More information about the Gdal-dev mailing list