Python編程圖形庫之Pillow使用方法講解

安裝

安裝可以通過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()

 

發佈了89 篇原創文章 · 獲贊 12 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章