I have chunks of rasters that I need to remove the no-data values so I can visualize them together and that they fit and do not overlap. I was using gdal_translate command
for %i in (*.tif) do gdal_translate -a_nodata -999 %i %~ni_NODATA2.tif
gbefore I check the black background in QGIS and the value is -999 and it worked great on some rasters like two pictures below show - before and after.
But in case of where the raster in not rectangular in the start, I am having problems and the command above does not seem to work correctly. It either happens that the black background stays the same and the raster is completely white or that the whole raster becomes black. Below there is also an image attached of this. I would like to get some help how can I work around this and remove only the black no-data like in the other rasters.