python中非常好用的图像处理库( 二 )

# importing libraries. import matplotlib.pyplot as plt from PIL import Image # open image using pillow library image = Image.open("tesla.png") #show original image plt.imshow(image) plt.show() # grayscale the image plt.imshow(image.convert("L"), cmap='gray') plt.show()




推荐阅读