Joseph Drackey

Generation

generate functionTue, 28 Mar 2023

Converts an image to grayscale using the crude average of the r, g, and b

def gray_scale(img): gray_image = np.zeros(img.shape) gray_image[:, :, 0] = gray_image[:, :, 1] = gray_image[:, :, 2] = np.mean(img[:, :, :], axis=2) return gray_image

Questions about programming?Chat with your personal AI assistant