Python Imaging Library: ImagePalette Module(图像调色板模块)
Python Imaging Library: ImagePalette Module(图像调色板模块)
FIXME: 这个部分不太符合当前现状。现在,将调色板添加到图像的最安全的方法是在字符串中使用调色板数据。
Examples:将调色板添加到图像中 (序列语法,Sequence Syntax)
palette = []
for i in range(256):
palette.extend((i, i, i)) # grayscale wedge
assert len(palette) == 768
im.putpalette(palette)
Examples:将调色板添加到图像中 (未支持)
import ImagePalette
palette = ImagePalette.ImagePalette("RGB")
palette.putdata(...)
im.putpalette(palette)
Examples:使用Resize/Convert获取调色板内容
assert im.mode == "P"
lut = im.resize((256, 1))
lut.putdata(range(256))
lut = lut.convert("RGB").getdata()
# lut now contains a sequence of (r, g, b) tuples
Classes
ImagePalette
ImagePalette.ImagePalette(mode=”RGB”) ⇒ palette instance
这个构造函数创建一个新的调色板,从“P”映射到给定的模式。
调色板被初始化到一个线性的灰度渐变。
Python Imaging Library: ImagePalette 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: ImagePath Module(图像路径模块)
Python Imaging Library: ImagePath Module(图像路径模块) ImagePath模块用于存储和操作二维向量数据.路径对象可以在 ImageDraw 模块中传递方法. ...
- 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模块来评估"图像表达式".这个模 ...
最新文章
- UVa 1339,紫书P73,词频
- python里面temp是啥-Python tempfile模块学习笔记(临时文件)
- 虚拟机登陆别的服务器吗,云服务器只能用虚拟机登录吗
- python工作目录_如何使用python 3获取当前工作目录?
- vue --- 使用component的 :is属性切换标签页
- Django复习:视图和模版
- go json tag 字符串 整数_json:你或许还不知道的序列化操作(一)
- Matlab中bsxfun和unique函数解析
- 微软Azure Services Bus中的工作流
- xe android 联系人,Delphi XE 开发android后台服务例程
- C/C++基础学习代码(1)
- 《数学建模与数学实验》第5版 线性规划 习题3.4
- 计算机软考网络工程师视频资料,计算机软考网络工程师视频教程
- SSM框架整合(Spring+SpringMVC+MyBatis)附源码
- 在CENTOS 7上安装SNIPE-IT进行资产管理
- 曼哈顿算法公式_Manhattan Distance Calculation(曼哈顿距离算法)
- springboot设置运行内存_spring boot应用优化,6s内启动,内存减半
- 移远EC25-xxx国外支持列表
- Zrlog开源博客网站 安装教程
- 【日拱一卒行而不辍20220926】自制操作系统