[gdal-dev] Availability of Lanczos and cubicspline in gdaladdo

Frank Warmerdam warmerdam at pobox.com
Mon Mar 30 17:48:14 EDT 2009


Benoit Andrieu wrote:
>>> The quality after downsizing images with gdalwarp is so perfect that I 
>>> am now willing to include this in my overviews.
>>> Is there any chances to have this include in future releases or is there 
>>> any difficulties I am not aware of ?
>> It is my intention to add a cubic resampling option to the overview
>> building for 1.7.  I am not planning to add the other options.
> 
> Are you not planning because there is nobody asking for (poor me) ?
> The image quality on our datasets is really amazing between merging with bilinear / cubicspline / Lanczos !
> I am surprised to be the first one to notice such a difference.
> I will try to see if gdaladdo and gdalwarp give the same results. I have a doubt right now.

Benoit,

I personally would prefer not to further complicate the overview
code with additional resampling types.  However, I have an insistent
client who will pay, and who might become grumpy if I did not oblige.

> Ok.
> Do you mean that producing a 1m x 1m image with 20cm x 20cm images could give bad results ?

In this case things might not be too bad, but these resampling
kernels basically have at most 4x4 kernels, so if you are
doing 20:1 downsampling only a small fraction of the pixels are
having any influence.  On the other hand in them more typical
1:1 resampling case you get nice results as a small window of
pixels in the area gets considered in the resampling.

For "1 step" radical downsampling something like average
may give better results than 4x4 kernel resamplers.

However, if downsampling is done stepwise (by powers of
2 for instance) then the 4x4 kernel resamplers may give
good results all the way.

> There is something I am not sure to understand.
> You are saying to use the warp library directly from the overviewing mechanism.

I am suggesting writing a small C application that would first
generate normal overviews, and the use the warper to overwrite
them with nicely downsampled imagery.

> Why can't I take the lanczos/cubicspline codes, separate it from the warping code to make a "library" callable from the overviewing and warping codes ?
> I think that the answer is a long one so if it is too much to ask, just say to me to look at the code ! ;)

This would be messy.  I am trying to avoid overcomplicating the overview
code which is already very complicated.  In fact it is already so
complicated that I'm mortified about extending it with cubic resampling.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list