I have these two GeoTIFF's:
https://terrafrost.com/gdal/1.tif
https://terrafrost.com/gdal/2.tif
I'm trying to merge them by doing gdal_merge -o result.tif 1-dark.tif 2-dark.tif
but when I do the result is just a solid gray image:
https://terrafrost.com/gdal/result.tif
Is there something I'm doing wrong? Do I need to do some pre-processing on the input GeoTIFF's? Maybe another tool would be better?
Best Answer
Gdalbuildvrt it better than gdal_merge.py for most use cases. However, your issue is easy to fix. Gdalinfo shows that source images are paletted, and both are having the same color table
From the documentation https://gdal.org/programs/gdal_merge.html:
So the gdal_merge command to use is
How to do the same with gdalbuildvrt:
Your original result.tif image is not solid gday. Running
gdalinfo result.tif -stats
shows that is has values 0 and 1 like the original paletted images have. But because the color table was not copied the image turned into grayscale with totally black and almost black pixels that eye cannot separate.