Hello,
maybe this question looks stupid, but I try to use Pillows Image.convert()
to convert an image to grayscale. This image I have store
Whilst you could perfectly well convert your Numpy array to a PIL Image and then convert that to greyscale and then convert back to a Numpy array like this:
PILImage = Image.fromarray(Numpyimg)
PILgrey = PILImage.convert('L')
Numpygrey= np.array(PILgrey)
You might as well just do the ITU-R 601-2 luma transform yourself, i.e.
L = 0.299 * Red + 0.587 * Green + 0.114 * Blue
So, you would get:
Numpygrey = np.dot(Numpyimg[...,:3], [0.299, 0.587, 0.114]).astype(np.uint8)