Login
main >   subtract_image >  


"""Remove Black from one image of other image.
"""
import cv2
import numpy as np

img = cv2.imread('image.png', 0)
img2 = cv2.imread('other.jpg', 0)
#test with all pixels the same value
#img2 = np.full(img.shape, 200).astype('uint8') 

#print(img.dtype)
#print(img2.dtype)

img3 = cv2.add(img,(255-img2))

cv2.imwrite('new.png', img3)
hidden1

hidden2