Python Imaging Library: ImageColor Module(图像颜色模块)
来源:互联网 发布:131458淘宝买家信官网 编辑:程序博客网 时间:2024/06/14 18:09
Python Imaging Library: ImageColor Module(图像颜色模块)
图像颜色模块(ImageColor Module)支持的字符串格式如下:
十六进制(Hexadecimal )颜色说明符,如“#rgb”或“#rrggbb”。例如,“#ff0000” 表示纯红色。
RGB函数,如“rgb(red, green, blue)” ,其中颜色值取值范围为【0-255】的整数。作为另外一种选择,也可以使用百分比(0%-100%)。例如“rgb(255,0,0)”和“rgb(100%,0%,0%)” 都表示纯红色。
Hue-Saturation-Lightness (HSL)函数,如“hsl(hue, saturation%, lightness%)” ,色度(Hue)取值范围为【0-360】(red=0, green=120, blue=240),饱和度(Saturation)取值范围为【0%-100%】 (gray=0%, full color=100%),亮度(lightness)取值范围为【0%-100%】 (black=0%, normal=50%, white=100%)。例如“hsl(0,100%,50%)”表示纯红色。
通用HTML颜色名称。图像颜色模块(ImageColor Module)支持140种标准颜色名称,包含基于X窗口系统和大多数web浏览器支持的颜色。颜色名称不区分大小写。例如“red” and “Red” 都表示纯红色。
函数
getrgb(color) ⇒ (red, green, blue)
(New in 1.1.4) Convert a colour string to an RGB tuple. If the string cannot be parsed, this function raises a ValueError exception.
getcolor(color, mode) ⇒ (red, green, blue) or integer
(New in 1.1.4) Same as getrgb, but converts the RGB value to a greyscale value if the mode is not color or a palette image. If the string cannot be parsed, this function raises a ValueError exception.
- 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: ImagePalette 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图像处理库PIL的ImageColor模块介绍
- Java MyBatis(1)--- Generator 详解
- Unity3D学习笔记3-响应用户输入
- 特殊符号不同浏览器之间的兼容性处理
- class小结
- Python导入模块的几种姿势(常规导入, 相对导入, 可选导入, 本地导入)
- Python Imaging Library: ImageColor Module(图像颜色模块)
- 洪水攻击原理
- 关于动态导出Excel
- 【概率&数学期望】A Dangerous Maze LightOJ
- 46. Permutations
- Qt + OpenGL + 离屏渲染
- 2017/10/26学习心得
- Python编程:从入门到实践的动手试一试答案(第二章)
- 经典题目-如何测试一个一次性纸杯