2017年10月1日 星期日

Python 3.4 安裝Pillow(PIL)


PIL(Python Imaging Library)是Python一個強大方便的影像處理庫,名氣也比較大。不過只支持到Python 2.7。
Pillow是PIL的一個派生分支,但如今已經發展成為比PIL本身更具活力的影像處理庫。目前最新版本是3.0.0。
o   Pillow的Github主頁:https://github.com/python-pillow/Pillow
o   Pillow的文檔(對應版本v3.0.0):https://pillow.readthedocs.org/en/latest/handbook/index.html
o   Pillow的文檔中文翻譯(對應版本v2.4.0):http://pillow-cn.readthedocs.org/en/latest/
Python 3.x 安裝Pillow
給Python安裝Pillow非常簡單,使用pip或easy_install只要一行代碼即可。
在命令行使用PIP安裝:
pip install Pillow
或在命令行使用easy_install安裝:
easy_install Pillow
安裝完成後,使用from PIL import Image就引用使用庫了。比如:
from PIL import Image
im = Image.open("bride.jpg")
im.rotate(45).show()
簡單,方便。


沒有留言:

張貼留言

零成本學 ESP32!在 Wokwi 打造你的第一個微型氣象站 (ESP32 + DHT22 + 1602 LCD)

零成本學 ESP32!在 Wokwi 打造你的第一個微型氣象站(溫度 濕度) (ESP32 + DHT22 + 1602 LCD) 想學物聯網(IoT)與 ESP32 電子實作,卻擔心接線與電壓規範搞砸嗎?透過強大的線上模擬器 Wokwi ,我們不需要花費任何硬體費用,打開瀏覽器...