日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程语言 > python >内容正文

python

python 图像处理(从安装Pillow开始)

發(fā)布時(shí)間:2023/11/30 python 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python 图像处理(从安装Pillow开始) 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
python 圖像處理(從安裝Pillow開始)

python2.x及以下用的是PIL(圖像處理庫(kù)是 PIL(Python Image Library)),最新版本是 1.1.7 ?可在http://www.pythonware.com/products/pil/index.htm?下載和學(xué)習(xí)。

不過從該網(wǎng)站可看出它不支持python3.x?

Pillow由PIL而來(支持3.x),所以該導(dǎo)入該庫(kù)使用import PIL?

由于本人用的是python 3.4 所以下載的Pillow

關(guān)于下載第三方庫(kù),有三種方法,之前用的都是

第一種方法

  1 下載第三方包,解壓

  2 在命令提示符里輸入cmd,然后用cd進(jìn)入到第三方包的路徑下

  3 輸入python setup.py build

  4 輸入python setup.py install

效率低下

故這次打算安裝pip和easy_installer工具,通過代碼就可以安裝,

安裝可參考:http://heipark.iteye.com/blog/1916758 或者h(yuǎn)ttp://blog.chinaunix.net/uid-12014716-id-3859827.html(內(nèi)有官網(wǎng)地址)

除此之外在相應(yīng)的官網(wǎng)也提供詳細(xì)的安裝教程(Mac OS的話真是快很多)

easy_installer簡(jiǎn)便安裝:

Windows (simplified)?(官網(wǎng)說明)

For Windows without PowerShell 3 or for installation without a command-line, download?ez_setup.py?using your preferred web browser or other technique and “run” that file.

保存本地后運(yùn)行就在安裝了,

pip安裝 法1:下載解壓,cd切換到pip的目錄,找到setup.py文件,然后輸入python setup.py install

最后顯示

Installed d:\python34\lib\site-packages\pip-7.1.2
Processing dependencies for pip==7.1.2
Finished processing dependencies for pip==7.1.2

法2(推薦):安裝完easy_install 后就可以執(zhí)行這樣的命令了

C:\Users\Administrator>easy_install pip Searching for pip Best match: pip 7.1.2 Processing pip-7.1.2-py3.4.egg pip 7.1.2 is already the active version in easy-install.pth Installing pip-script.py script to D:\python34\Scripts Installing pip.exe script to D:\python34\Scripts Installing pip.exe.manifest script to D:\python34\Scripts Installing pip3-script.py script to D:\python34\Scripts Installing pip3.exe script to D:\python34\Scripts Installing pip3.exe.manifest script to D:\python34\Scripts Installing pip3.4-script.py script to D:\python34\Scripts Installing pip3.4.exe script to D:\python34\Scripts Installing pip3.4.exe.manifest script to D:\python34\ScriptsUsing d:\python34\lib\site-packages\pip-7.1.2-py3.4.egg Processing dependencies for pip Finished processing dependencies for pip

?

那么接下來就是pip的使用(可參考http://www.th7.cn/Program/Python/201410/289949.shtml)

C:\Users\Administrator>pip install Pillow Collecting PillowDownloading Pillow-2.9.0-cp34-none-win32.whl (1.2MB)100% |████████████████████████████████| Installing collected packages: Pillow Successfully installed Pillow-2.9.0

那么pillow就安裝成功了

在Pillow的官網(wǎng)教程也有教程http://pillow.readthedocs.org/installation.html 多種安裝方式可參考

?

接下來

C:\Users\Administrator>python Python 3.4.2 (v3.4.2:ab2c023a9 Type "help", "copyright", "cre >>> 2 2 >>> from PIL import Image >>>

沒報(bào)錯(cuò),說明安裝成功

接下來可在http://pillow.readthedocs.org/index.html開始學(xué)習(xí),或參考他人blog 后面將繼續(xù)出圖像處理的例子~

?

posted on 2015-09-30 11:43 france 閱讀(...) 評(píng)論(...) 編輯 收藏

轉(zhuǎn)載于:https://www.cnblogs.com/france/p/4848778.html

總結(jié)

以上是生活随笔為你收集整理的python 图像处理(从安装Pillow开始)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。