With the following code I can set 100% transparency to raster value 0:
map=None
for lyr in QgsMapLayerRegistry.instance().mapLayers().values():
if lyr.name() == "some_layer":
map= lyr
tr=None
tr=QgsRasterTransparency()
tr.initializeTransparentPixelList(0)
map.renderer().setRasterTransparency(tr)
map.triggerRepaint()
How can I define two values (0 and 8) to be 100% transparent?
When I repeat the commands of the last block with raster value 8, the first value (0) is removed from the layer transparency.
