Python图像处理-1.pil读取图像,显示图像

 

from PIL import Image
import matplotlib.pyplot as plt

pil_im1 = Image.open('pic1.png')
pil_im2 = Image.open('pic1.png').convert('L')

plt.figure("girlfriend1")
plt.imshow(pil_im1)
plt.figure("girlfriend2")
plt.imshow(pil_im2)
plt.show()

 

你可能感兴趣的:(Python,PIL,图像学习)