I need to convert RGB image to grayscale without using rgb2gray pre-made code.
I am already getting an error saying "Index in position 3 exceeds array bounds. Index must not exceed 1."
How do I convert RGB to grayscale without rgb2gray? Also, how do I convert back to rgb from grayscale?
RGB_image = ('peppers.png');