Skip to content

Instantly share code, notes, and snippets.

@Nerdyvedi
Nerdyvedi / alpha_mask_blend.py
Last active March 19, 2019 12:55 — forked from garybradski/alpha_mask_blend.py
Blend one image with another using an alpha mask in python
import cv2
# Read the images
foreground = cv2.imread("puppets.png")
background = cv2.imread("ocean.png")
alpha = cv2.imread("puppets_alpha.png")
# Convert uint8 to float
foreground = foreground.astype(float)
background = background.astype(float)