I want to use gdal_merge.py for creating rgb composite from 3 bands with the same qualities (resolution, crs..), but here I found that gdal_merge.py is using nearest neighbor resampling method.

Is resampling used also in my case, when bands do have the same resolution? Is there better way to create composite using gdal?

Afterwards I want to use gdal_pansharpen.py, what about resampling there?

  • 1
    Nearest neighbor resampling from one image into another one that has same pixel size and dimensions is just a copy.
    – user30184
    Apr 24, 2017 at 12:39

1 Answer 1


No, if your bands all have the same resolution, no resampling will occur when using gdal_merge.py. So it's perfectly fine to use it.

As for "Pansharpening": Since the process aims to turn a low-res color image into a high-res color image with the help of a high-res panchromatic image, naturally resampling is involved. In a common implementation this would be an upsampling of the color bands to the resolution of the panchromatic band as the first step. However the resampling algorithm only partially determines the result, as after upsampling, other steps follow (aligning, intensity transform, substitution).

By default gdal_pansharpen.py uses Cubic resampling. However you can change the resampling algorithm with the -r parameter:

-r {nearest,bilinear,cubic (default),cubicspline,lanczos,average}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.