PIL和Pillow

關於Pillow與PIL

PIL(Python Imaging Library)是Python一個強大方便的圖像處理庫,名氣也比較大。不過只支持到Python 2.7。

PIL官方網站:http://www.pythonware.com/products/pil/

Pillow是PIL的一個派生分支,但現在已經發展成爲比PIL自己更具活力的圖像處理庫。目前最新版本是3.0.0。

Pillow的Github主頁:https://github.com/python-pillow/Pillow
Pillow的文檔(對應版本v3.0.0):https://pillow.readthedocs.org/en/latest/handbook/index.html
Pillow的文檔中文翻譯(對應版本v2.4.0):http://pillow-cn.readthedocs.org/en/latest/

Python 3.x 安裝Pillow

給Python安裝Pillow很是簡單,使用pip或easy_install只要一行代碼便可。

在命令行使用PIP安裝:html

pip install Pillow

或在命令行使用easy_install安裝:python

easy_install Pillow

安裝完成後,使用from PIL import Image就引用使用庫了。好比:git

from PIL import Image im = Image.open("bride.jpg") im.rotate(45).show()
相關文章
相關標籤/搜索