[GIS] Displaying black background pixels in RGB raster as transparent (QGIS)

qgisrastertransparency

I have the following RGB raster and would like to remove the black background (where R=0, G=0, B=0). I'm using QGIS.

The problem is that the raster itself also contains black pixels. Using the option of QGIS to make all RGB(0,0,0) pixels transparent is therefore not an option, since it will make some of the lines transparent as well. Are there any other options?

enter image description here

Best Answer

Try to use nearblack gdal utility for make raster with transparent background.