def load_vrt(self, iface, suffix=""):
        # Add to project
        layer = iface.addRasterLayer(self.path + ".vrt",
                                     "VRT-{}{}".format(self, suffix))
        layer.setCrs(self.drone_map.crs_dest)

        # We make black pixels transparent to remove the rotated frame, not ideal if there are actually black pixels in the image
        rasterTransparency = layer.renderer().rasterTransparency()
        pixel = QgsRasterTransparency.TransparentThreeValuePixel()
        pixel.red, pixel.green, pixel.blue, pixel.percentTransparent = 0, 0, 0, 100
        rasterTransparency.setTransparentThreeValuePixelList([pixel])
 def setTransparency(raster):
     renderer = raster.renderer()
     tvp, setTransparent = None, None
     if isinstance(renderer, QgsSingleBandGrayRenderer):
         tvp = QgsRasterTransparency.TransparentSingleValuePixel()
         setTransparent = renderer.rasterTransparency(
         ).setTransparentSingleValuePixelList
     elif isinstance(renderer, QgsMultiBandColorRenderer):
         tvp = QgsRasterTransparency.TransparentThreeValuePixel()
         tvp.percentTransparent = 100.0
         setTransparent = renderer.rasterTransparency(
         ).setTransparentThreeValuePixelList
     else:
         return
     tvp.percentTransparent = 100.0
     setTransparent([tvp])
     raster.triggerRepaint()
 def getListTTVP():
     t = QgsRasterTransparency.TransparentThreeValuePixel()
     t.red = t.green = t.blue = 0.0
     t.percentTransparent = 100.0
     return [t]