Python Imaging Library: ImagePath Module(图像路径模块)
Python Imaging Library: ImagePath Module(图像路径模块)
ImagePath模块用于存储和操作二维向量数据。路径对象可以在 ImageDraw 模块中传递方法。
函数
Path
ImagePath.Path(coordinates) ⇒ Path instance
创建一个路径对象。
坐标列表可以是任何包含二元组[(x, y)]的序列对象,或者数值[x, y, ……]。
您还可以从另一个path对象创建path对象。
在版本1.1.6和更高版本中,您还可以传入任何实现Python缓冲区API的对象。
缓冲区应该提供读访问,并在机器字节顺序中包含C浮点数。
Path对象实现了Python序列接口的大部分,并且表现得像一个(x,y)对的列表。您可以使用常用的len()、条目访问和片分配。
但是,当前版本不支持片分配,也不支持项目和片删除。
Path Methods
compact
p.compact(distance=2) ⇒ count
通过删除彼此相近的点来压缩路径。该方法修改路径,并返回路径中留下的点的数量。
distance距离被测量为“城市块距离,city-block distance”,并且默认为两个像素。
getbbox
p.getbbox() ⇒ 4-tuple
得到路径的边界框。
map
p.map(function)
通过一个函数映射路径。
tolist
p.tolist() ⇒ list
将路径转换为Python列表 [ (x, y)…… ]。
p.tolist(flat=0) ⇒ list
(版本1.1.5)将路径转换为Python列表。
如果flat标记为0或省略,则结果列表包含二元组[(x,y), …]。
如果flat标记是1,那么这个列表就是平坦的x y。
transform
p.transform(matrix)
使用仿射变换将路径转换成位置。
这个矩阵是一个六元组(a、b、c、d、e、f),每个点都被映射成如下:
xOut = xIn * a + yIn * b + cyOut = xIn * d + yIn * e + f
Python Imaging Library: ImagePath Module(图像路径模块)相关推荐
- Python Imaging Library: ImageFile Module(图像文件模块)
Python Imaging Library: ImageFile Module(图像文件模块) ImageFile模块为图像打开和保存功能提供了支持函数. 此外,它还提供了一个解析器类,可以被用来对 ...
- Python Imaging Library: ImageEnhance Module(图像增强模块)
Python Imaging Library: ImageEnhance Module(图像增强模块) # 图像增强模块(ImageEnhance Module) PilImg_Enhance = I ...
- Python Imaging Library: ImageSequence Module(图像序列模块)
Python Imaging Library: ImageSequence Module(图像序列模块) ImageSequence模块包含一个包装器类,可以让您遍历图像序列中的所有帧. Functi ...
- Python Imaging Library: ImageWin Module(图像Windows模块)
Python Imaging Library: ImageWin Module(图像Windows模块) ImageWin模块支持在Windows上创建和显示图像. ImageWin可以与Python ...
- Python Imaging Library: ImageTk Module(图像Tkinter模块)
Python Imaging Library: ImageTk Module(图像Tkinter模块) ImageTk模块支持从图片中创建和修改Tkinter位图图像和PhotoImage对象. 例如 ...
- Python Imaging Library: ImageQt Module(图像QT模块)
Python Imaging Library: ImageQt Module(图像QT模块) (版本1.1.6) ImageQt 模块支持从图片中创建PyQt4 QImage对象. 注意:如果你使用的 ...
- Python Imaging Library: ImagePalette Module(图像调色板模块)
Python Imaging Library: ImagePalette Module(图像调色板模块) FIXME: 这个部分不太符合当前现状.现在,将调色板添加到图像的最安全的方法是在字符串中使用 ...
- Python Imaging Library: ImageOps Module(图像运算模块)
Python Imaging Library: ImageOps Module(图像运算模块) (版本1.1.3) ImageOps模块包含许多"现成的"图像处理操作.这个模块是实 ...
- Python Imaging Library: ImageMath Module(图像数学运算模块)
Python Imaging Library: ImageMath Module(图像数学运算模块) (新版本1.1.6)可以使用ImageMath模块来评估"图像表达式".这个模 ...
最新文章
- 最全芯片产业报告出炉,计算、存储、模拟IC一文扫尽
- 异步加载js文件的方法总结
- linux 添加虚拟网卡
- StringBuilder与String互转
- [Prism]Composite Application Guidance for WPF(10)——系列目录导航
- idea 编译显示source1.3不支持泛型(请使用source5或更高版本)
- xss img onerror java_java后台防止XSS的脚本攻击
- 线程名称的获取与修改
- Vue 学习笔记(3)路由的基本使用 结合 SpringBoot
- zookeeper启动失败的排错 no route to host 防火墙未关闭导致的
- 全面总结Java泛型
- zabbix 通过 SNMP 监控 Windows主机
- mysql导入sql文件乱码或者报错unknown command
- 大数据趣味学习探讨(三):怎么确定学习目标
- Ubuntu12.04软件安装指南
- python简单网格五子棋_python实现简单五子棋游戏
- CVPR 2021 华南理工和微信的Transformer:UP-DETR无监督预训练检测器
- 2020年-数据库实验详述-BUPT 信通院-- 十安辰
- Instruments相关
- Ubuntu18.04 安装搜狗输入法
热门文章
- 解决 DBMS_AW_EXP: BIN$*****==$0 not AW$
- Android IPC 结篇
- GPS(北斗)拓展无线同步模块GSYN1000系列在电力、大坝、隧道、核电、密闭厂房的应用方案...
- Oracle 11g数据库详细安装步骤图解
- useradd和adduser的区别
- 1.窗体与界面设计-菜单应用实例
- Linux 配置本地yum源步骤
- Kafka——使用spring进行集成
- java转换 HTML字符实体,java特殊字符转义字符串
- ganglia的搭建以及添加被监控主机