I refer to the Problem/Solution in this Article:
Output of gdal2tiles has black edges round it
I've the same problem and tried so many options and variations with no success. :( I've some geotiffs (tif + tfw) with a black background (this shoud be transparent in the finels TMS). First i create a VRT Layer by:
gdalbuildvrt.exe "C:\Tiles\huenenberg.vrt" "C:\Tiles\huenenberg/*.tif"
Second i create the TMS by GDAL2TILES by:
python3 C:/OSGeo4W64/bin/gdal2tiles.py --profile=mercator -s EPSG:21781 --processes=6 -z 10-15 -e -a 0,0,0 "C:\Tiles\huenenberg.vrt" "C:/Tiles/huenenberg/tileset/"
I tried with different options, but i cant't eleminate the black triangle-border.
I also tried first to reproject by gdalwarp with no success.
-vrtnodataoption is worth a try https://gdal.org/programs/gdalbuildvrt.html, perhaps together with-srcnodata. – user30184 Dec 15 '20 at 21:01