how to plot grayscale image in python code example
Example 1: imshow grayscale
plt.imshow(im, cmap='gray')
Example 2: python image to grayscale
from PIL import Image
img = Image.open("image.jpg")
img.convert("L").save("result.jpg")
plt.imshow(im, cmap='gray')
from PIL import Image
img = Image.open("image.jpg")
img.convert("L").save("result.jpg")