def DrawBlurredRectangle(image, bbox, alpha=0.6):
  # Blend image
  other = image.copy()
  # other = Image.new(image.mode, image.size)

  draw = ImageDraw.Draw(other)
  # Draw rectangle before text
  draw.rectangle([(bbox[0], bbox[1]), (bbox[2], bbox[3])],
                 fill=settings.QUOTE_BG_COLOR)

  # other = other.filter(ImageFilter.BLUR)

  return Image.blend(image, other, alpha)
Blends a rectangle into the image with given alpha.
dataset/ETHPy150Open GoogleCloudPlatform/solutions-orchestrator-android-sampleapp-smashpix/daemon/image_processing.py/DrawBlurredRectangle