QGIS can easily display geo-referenced raster images; by default the background pixels or no data value pixels are colored as black, as shown in the screenshot below.
The black no data colored pixels can obscure other vector or raster data underneath it. You can use QGIS to define a color to be rendered as transparent in the raster layer's properties. This can be easily done for a single raster layer. If you want to do it for multiple raster layers at once, then you have to copy the style of the raster layer with a transparent color set and apply that style to the rest of the raster layers.
This post illustrates the steps.
Define the transparent color for a single raster layer
- Start up QGIS. Load and display the raster images.
The raster layers are displayed with black as the background color. - In the Layers pane, mouse right click on a raster layer. Choose Properties. Select Transparency.
The Properties dialog box is displayed. - In the Transparency pixel list, click the + icon.
An RGB entry is added to the list. - In the Red, Green, and Blue fields, enter 0.
- Click OK.
The selected raster layer's background pixels are rendered transparent. - In the Layers pane, mouse right click on the raster layer with transparent background and choose Styles | Copy Style.
- In the Layers pane again, press CTRL or SHIFT and select one or more raster layers.
Multiple raster layers are selected. - In the Layers pane, mouse right click on a selected raster layer and choose Paste Style.
The selected raster layers' background is rendered transparent.
1 comment:
Thank you for this
Post a Comment