Skip to content

Instantly share code, notes, and snippets.

@Nithilaa
Created October 27, 2021 06:36
Show Gist options
  • Save Nithilaa/c1f5b0a1049d979d45d1c01827681d43 to your computer and use it in GitHub Desktop.
Save Nithilaa/c1f5b0a1049d979d45d1c01827681d43 to your computer and use it in GitHub Desktop.
import cv2
img1 = cv2.imread('image1_add.jpg', 1)
#or
#img1 = cv2.imread('C:\\Users\\Admin\\Downloads\\image1_add.jpg', 1)
cv2.imshow('Image 1', img1)
cv2.waitKey(0)
cv2.destroyAllWindows()
img2 = cv2.imread('image2_add.jpg', 1)
#or
#img2 = cv2.imread('C:\\Users\\Admin\\Downloads\\image2_add.jpg', 1)
cv2.imshow('Image 2', img2)
cv2.waitKey(0)
cv2.destroyAllWindows()
# Add the images
added_img = cv2.add(img1, img2)
cv2.imshow('Added Image', added_img)
cv2.waitKey(0)
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment