Last active
May 20, 2018 15:47
-
-
Save benjamintanweihao/0e9bf8d125be4eea90dd0f815c97f5e6 to your computer and use it in GitHub Desktop.
Making an image transparent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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