code: def _reduce_opacity(self, watermark, opacity):
          
  
          if watermark.type() != ImageType.TrueColorMatteType:
              watermark.type(ImageType.TrueColorMatteType)
          depth = 255 - int(255 * opacity)
          watermark.quantumOperator(ChannelType.OpacityChannel, QuOp.MaxQuantumOp, depth)
docs: Returns an image with reduced opacity. Converts image to RGBA if needs.
  
          Simple watermark.opacity(65535 - int(65535 * opacity) would not work for
          images with the Opacity channel (RGBA images). So we have to convert RGB or any
          other type to RGBA in this case