TransWikia.com

QGIS Raster Layer - Black rectangle appears as background

Geographic Information Systems Asked on August 15, 2021

enter image description hereI have looked at solutions to what seem to be somewhat similar problems but they don’t seem to solve my problem. A georeferenced raster layer loads into the correct location in relation to other layers, so CRS is obviously OK, but has this black background which I don’t know how to remove.

enter image description here

2 Answers

1. Method

To remove the black border temporarily in QGIS, you can set the "Additional no data value" in Layer properties -> Transparency to 0 (or 000000). If the border is not 100% black you can use the information tool to find out which color you need to set to transparent. If the border is not evenly black, you can use the custom transparent pixel list in the same window below.

Additional No Data Value

2. Method

If you like to permanently remove the black border in your image by adding an alpha channel, you can use the GDAL Tool nearblack: Go to Raster -> Analysis -> Near Black and set the in- and ouputfile, then use the edit pen to add -setalpha and -of GTiff.

nearblack -of GTiff -setalpha -o output.tif input.tif

Near Black

(Of course you need to set output.tif and input.tif to your needs)

Answered by pLumo on August 15, 2021

[![][1]][1]

Add the None band and set the RGB values to 0-0-0, Certainly the black background goes. https://i.stack.imgur.com/xD94j.png

Answered by Rashmita on August 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP