I need an help to convert an array of rgb values (3 channels) into a single dimension grayscale array. Thank you so much.
Asked
Active
Viewed 81 times
-1
-
Are you using some kind of graphics package? If so it will likely have a conversion function built in. – Mark Ransom Sep 18 '22 at 16:00
-
Does this answer your question? [Converting RGB to grayscale/intensity](https://stackoverflow.com/questions/687261/converting-rgb-to-grayscale-intensity) – Queeg Sep 18 '22 at 16:06
1 Answers
0
If you are using PIL or Pillow to hold your RGB values as an image, the conversion is trivial:
gray_image = rgb_image.convert('L')

Mark Ransom
- 299,747
- 42
- 398
- 622