Oct-31-2017, 08:19 PM
Hello guys,
Now I used PIL to convert my image from RGB to Grayscale, and then I use the matplotlib to show the coordinate value and greyscale value of every pixel on image. The problem is the image shown on the screen doesn't looks like a greyscale image but it can successfully show me the pixel coordinate value and greyscale value of the image. I don't know why it happens.
from PIL import Image import matplotlib.image as mpimg import matplotlib.pyplot as plt img=Image.open('beam.jpg').convert('L') img.save('gray_beam.jpg') im=mpimg.imread('gray_beam.jpg') a=plt.imshow(im) plt.show(a)