Deep-ML is a free, open-source machine learning challenge platform. Practice ML coding problems, work with real datasets in labs, and learn through interactive articles.
Please enable JavaScript to use the full platform.
image = [[[255, 0, 0], [0, 255, 0]], [[0, 0, 255], [255, 255, 255]]] print(rgb_to_grayscale(image))
[[76, 150], [29, 255]]
Using the luminosity formula: Gray = 0.299R + 0.587G + 0.114*B
Deep-ML
Implement rgb_to_grayscale(image) that converts an RGB image to grayscale.
rgb_to_grayscale(image)
image
-1