Python Imaging Library: ImagePalette Module(图像调色板模块)
来源:互联网 发布:深圳市软件企业 退税 编辑:程序博客网 时间:2024/06/05 15:16
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 ImagePalettepalette = 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”映射到给定的模式。
调色板被初始化到一个线性的灰度渐变。
阅读全文
0 0
- Python Imaging Library: ImagePalette Module(图像调色板模块)
- Python Imaging Library: ImageColor Module(图像颜色模块)
- Python Imaging Library: ImageChops Module(图像通道操作模块)
- Python Imaging Library:ImageDraw Module(图像绘制模块)
- Python Imaging Library: ImageEnhance Module(图像增强模块)
- Python Imaging Library: ImageFilter Module(图像滤波模块)
- Python Imaging Library: ImageGrab Module(图像采集模块)
- Python Imaging Library: ImageMath Module(图像数学运算模块)
- Python Imaging Library: ImageOps Module(图像运算模块)
- Python Imaging Library: ImagePath Module(图像路径模块)
- Python Imaging Library: ImageQt Module(图像QT模块)
- Python Imaging Library: ImageSequence Module(图像序列模块)
- Python Imaging Library: ImageStat Module(图像统计模块)
- Python Imaging Library: ImageTk Module(图像Tkinter模块)
- Python Imaging Library: ImageWin Module(图像Windows模块)
- Python Imaging Library: ImageFile Module(图像文件模块)
- Python Imaging Library: PSDraw Module(Postscript打印机模块)
- 安装 Python Imaging Library(PIL)
- 网页登录数据库(七)
- Windows10 64位系统下成功安装Caffe(CPU+VS 2013)
- 020day(指针的基本概念和用法,意义和互相赋值)
- Redis配置主从架构,实现读写分离
- RSA 算法笔记
- Python Imaging Library: ImagePalette Module(图像调色板模块)
- jp第一天
- [python]库
- sql语句实现简单查询以及索引查询
- MLE、ERM和MAP、SRM
- 卡住:图片上传并回显
- NOIP2017赛前模拟 Game DP (2017.10.30)
- numpy中的mean()函数
- 关于立即运行函数