python 图像处理(从安装Pillow开始)
python2.x及以下用的是PIL(图像处理库是 PIL(Python Image Library)),最新版本是 1.1.7 可在http://www.pythonware.com/products/pil/index.htm 下载和学习。
不过从该网站可看出它不支持python3.x
Pillow由PIL而来(支持3.x),所以该导入该库使用import PIL
由于本人用的是python 3.4 所以下载的Pillow
关于下载第三方库,有三种方法,之前用的都是
第一种方法
1 下载第三方包,解压
2 在命令提示符里输入cmd,然后用cd进入到第三方包的路径下
3 输入python setup.py build
4 输入python setup.py install
效率低下
故这次打算安装pip和easy_installer工具,通过代码就可以安装,
安装可参考:http://heipark.iteye.com/blog/1916758 或者http://blog.chinaunix.net/uid-12014716-id-3859827.html(内有官网地址)
除此之外在相应的官网也提供详细的安装教程(Mac OS的话真是快很多)
easy_installer简便安装:
Windows (simplified) (官网说明)
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.
保存本地后运行就在安装了,
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 后就可以执行这样的命令了
C:\Users\Administrator>easy_install pip
Searching for pip
Best match: pip 7.1.
Processing pip-7.1.-py3..egg
pip 7.1. 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.-script.py script to D:\python34\Scripts
Installing pip3..exe script to D:\python34\Scripts
Installing pip3..exe.manifest script to D:\python34\Scripts Using d:\python34\lib\site-packages\pip-7.1.-py3..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 Pillow
Downloading Pillow-2.9.0-cp34-none-win32.whl (1.2MB)
100% |████████████████████████████████|
Installing collected packages: Pillow
Successfully installed Pillow-2.9.0
那么pillow就安装成功了
在Pillow的官网教程也有教程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
>>>
没报错,说明安装成功
接下来可在http://pillow.readthedocs.org/index.html开始学习,或参考他人blog 后面将继续出图像处理的例子~
python 图像处理(从安装Pillow开始)的更多相关文章
- Python图像处理库:Pillow 初级教程
Python图像处理库:Pillow 初级教程 2014-09-14 翻译 http://pillow.readthedocs.org/en/latest/handbook/tutorial.html ...
- Windows下Python中pip安装Pillow报错总结(转载)
遇到的俩种错误1.ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting 问题原因 ...
- Python验证码识别 安装Pillow、tesseract-ocr与pytesseract模块的安装以及错误解决
1.安装Pillow pip install Pillow 2.安装tesseract-ocr OCR(Optical Character Recognition, 光学字符识别) 软件 安装包含两个 ...
- Python图像处理库:Pillow 初级教程-乾颐堂
Image类 Pillow中最重要的类就是Image,该类存在于同名的模块中.可以通过以下几种方式实例化:从文件中读取图片,处理其他图片得到,或者直接创建一个图片. 使用Image模块中的open函数 ...
- python3.4.2 安装Pillow
Python 3.x 安装Pillow给Python安装Pillow非常简单,使用pip或easy_install只要一行代码即可.在命令行使用PIP安装: pip install Pillow或在命 ...
- 安装python的第三方库pillow
参考:http://jingyan.baidu.com/article/ff42efa929e6c8c19f220254.html 用Python做图像处理时,需要用到PIL(图像处理库).但是PIL ...
- 图像处理基本工具——Python 环境下的 Pillow( PIL )
由于笔者近期的研究课题与图像后处理有关,需要通过图像处理工具对图像进行变换和处理,进而生成合适的训练图像数据.该系列文章即主要记录笔者在不同的环境下进行图像处理时常用的工具和库.在 Python 环境 ...
- python 安装pillow
安装 警告 Pillow >= 2.1.0 不支持 “import _imaging”.请使用 “from PIL.Image import core as _imaging” 代替. 警告 P ...
- python安装pillow模块错误
安装的一些简单步骤就不介绍了,可以去搜索一下,主要就记录下我在安装pillow这一模块遇到的问题 1:安装好pillow后,安装过程没有出错 2:但是在python的IDLE输入from PIL im ...
随机推荐
- react-native-storage 使用笔记 持续更新
React-native-storage是在AsyncStorage之上封装的一个缓存操作插件库,刚开始接触这个也遇到了一些问题,在这里简单记录总结一下,碰到了就记下来,持续更新吧 1.安卓下stor ...
- Oracle_spatial的空间操作符介绍
空间操作符 一.主要空间操作符 1.SDO_FILTER SDO_FILTER(geometry1, geometry2, param); 判断两个几何体是否有相交 SELECT c.mkt_id, ...
- 网络编程_UDP协议_聊天程序
发送端:(将数据源改为键盘录入) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStre ...
- BZOJ3998:[TJOI2015]弦论(SAM)
Description 对于一个给定长度为N的字符串,求它的第K小子串是什么. Input 第一行是一个仅由小写英文字母构成的字符串S 第二行为两个整数T和K,T为0则表示不同位置的相同子串算作一个. ...
- C#启动另一个应用程序并传参数
第一个程序: try { ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = "Windows ...
- Chrome插件(扩展)开发全攻略
[干货]Chrome插件(扩展)开发全攻略:https://www.cnblogs.com/liuxianan/p/chrome-plugin-develop.html
- docker swarm英文文档学习-1-概述
参考https://docs.docker.com/engine/swarm/ Swarm mode overview群模式概述 Docker的当前版本包括集群模式,用于本地管理称为集群的Docker ...
- 环境搭建(Python)
Python 开发环境搭建 Windows篇 一. Python安装 资源获取 登录Python官网的Windows下载页面https://www.python.org/downloads/win ...
- 使用Java线程并发库实现两个线程交替打印的线程题
背景:是这样的今天在地铁上浏览了以下网页,看到网上一朋友问了一个多线程的问题.晚上闲着没事就决定把它实现出来. 题目: 1.开启两个线程,一个线程打印A-Z,两一个线程打印1-52的数据. 2.实现交 ...
- [HNOI2012]集合选数 BZOJ2734
分析: 构造法...每次找到一个没有被选过的数,用这个数推出一个表格,之后在表格上跑状压DP,时间复杂度O(n) 附上代码: #include <cstdio> #include < ...