Skip to content

Instantly share code, notes, and snippets.

@benjamintanweihao
Last active May 20, 2018 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjamintanweihao/0e9bf8d125be4eea90dd0f815c97f5e6 to your computer and use it in GitHub Desktop.
Save benjamintanweihao/0e9bf8d125be4eea90dd0f815c97f5e6 to your computer and use it in GitHub Desktop.
Making an image transparent
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGBA)
image[np.all(image == [0, 0, 0, 255], axis=2)] = [0, 0, 0, 0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment