Thursday, July 3, 2025

Create color image using R, G and B three separate planes

 import cv2

import numpy as np

height, width = 300, 300

R = np.full((height, width), 255, dtype=np.uint8) # Red plane (fully red)

G = np.zeros((height, width), dtype=np.uint8) # Green plane (zero)

B = np.full((height, width), 100, dtype=np.uint8) # Blue plane (some blue)

color_image = cv2.merge([B, G, R])

cv2.imshow("Color Image from R, G, B Planes", color_image)

cv2.waitKey(0)

cv2.destroyAllWindows()

No comments:

Post a Comment

Complete Works of Swami Vivekananda [Volume 8,Page - 2069]

  Complete Works of Swami Vivekananda [ Volume 8, Page - 2069] Jesus Christ was God — the Personal God become man. He has manifested Himsel...