安装
安装可以通过pip,只需要执行pip install pillow即可
from PIL import ImageGrab
from PIL import ImageFilter,Image
#get current screen copy
image = ImageGrab.grab()
#display image size
print("Current screen shot size :",image.size)
print("Screen shot picture mode:",image.mode)
#save
image.save('screen-grab-1.bmp')
#show picture
image.show()
src_image=Image.open('screen-grab-1.bmp')
#CONTOUR 滤镜
dist_image=src_image.filter(ImageFilter.CONTOUR)
#show picture
dist_image.show()