import cv2 import numpy as np # Load the image img = cv2.imread("image_508.jpg") # Set the G channel to zero img[:, :, 1] = 0 # Display the modified image cv2.imshow("Image without G channel", img) cv2.waitKey(0) cv2.destroyAllWindows()