Steps
- use earth engine to export a geotiff of the median modis in higher resolution than you need. https://code.earthengine.google.com/5ce94569601c58a14bcaf28c1852e006
- download them
- build a vrt file
gdalbuildvrt g.vrt greenland-modis-median-julyaugust-100m-*.tif
- convert it to a geotiff - e.g. lerc10
gdal_translate -of COG -co "COMPRESS=LERC_DEFLATE" -co "MAX_Z_ERROR=10" -a_nodata 0 -ot uint16 g.vrt -tr 250 250 -r lanczos greenland-modis-median-julyaugust-250m-lerc10.tif
- convert it to a jpeg compressed geotiff.
gdal_translate -of COG -co "COMPRESS=JPEG" -co "TILED=YES" -scale 0 10000 0 255 -a_nodata 0 -exponent .3 -ot byte -a_nodata 0 -tr 250 250 -r lanczos g.vrt greenland-modis-median-julyaugust-250m-jpeg.tif
- make a mask for the black pixels (this should probably be adjusted):
nearblack -setmask -nb 7 -near 20 greenland-modis-median-julyaugust-250m-jpeg.tif