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(图像颜色模块)相关推荐

  1. Python Imaging Library: ImageEnhance Module(图像增强模块)

    Python Imaging Library: ImageEnhance Module(图像增强模块) # 图像增强模块(ImageEnhance Module) PilImg_Enhance = I ...

  2. Python Imaging Library: ImageFile Module(图像文件模块)

    Python Imaging Library: ImageFile Module(图像文件模块) ImageFile模块为图像打开和保存功能提供了支持函数. 此外,它还提供了一个解析器类,可以被用来对 ...

  3. Python Imaging Library: ImageSequence Module(图像序列模块)

    Python Imaging Library: ImageSequence Module(图像序列模块) ImageSequence模块包含一个包装器类,可以让您遍历图像序列中的所有帧. Functi ...

  4. Python Imaging Library: ImageTk Module(图像Tkinter模块)

    Python Imaging Library: ImageTk Module(图像Tkinter模块) ImageTk模块支持从图片中创建和修改Tkinter位图图像和PhotoImage对象. 例如 ...

  5. Python Imaging Library: ImageOps Module(图像运算模块)

    Python Imaging Library: ImageOps Module(图像运算模块) (版本1.1.3) ImageOps模块包含许多"现成的"图像处理操作.这个模块是实 ...

  6. Python Imaging Library: ImageWin Module(图像Windows模块)

    Python Imaging Library: ImageWin Module(图像Windows模块) ImageWin模块支持在Windows上创建和显示图像. ImageWin可以与Python ...

  7. Python Imaging Library: ImageQt Module(图像QT模块)

    Python Imaging Library: ImageQt Module(图像QT模块) (版本1.1.6) ImageQt 模块支持从图片中创建PyQt4 QImage对象. 注意:如果你使用的 ...

  8. Python Imaging Library: ImagePath Module(图像路径模块)

    Python Imaging Library: ImagePath Module(图像路径模块) ImagePath模块用于存储和操作二维向量数据.路径对象可以在 ImageDraw 模块中传递方法. ...

  9. Python Imaging Library: ImagePalette Module(图像调色板模块)

    Python Imaging Library: ImagePalette Module(图像调色板模块) FIXME: 这个部分不太符合当前现状.现在,将调色板添加到图像的最安全的方法是在字符串中使用 ...

最新文章

  1. GBDT(MART) 迭代决策树入门教程 | 简介 .
  2. 获取cookie里面的值
  3. 洛谷 P3243 【[HNOI2015]菜肴制作】
  4. 计量经济学自相关matlab,计量经济学 自相关性.ppt
  5. 11-Flutter移动电商实战-首页_屏幕适配方案和制作
  6. 曝光!衡中教室高清摄像头记录:不想一辈子吃苦,就必须闻鸡起舞!(转给学生)...
  7. 从L1 loss到EIoU loss,目标检测边框回归的损失函数一览
  8. 一段不错的话透过公车的玻璃窗突然看见你
  9. 删除百度贴吧上的内容
  10. php中dialog使用方法,window.dialogArguments 使用说明
  11. Java下载服务器文件
  12. 读笔:《重来也不会好过现在》
  13. 微信小程序项目实例SSM在线考试管理系统+后台
  14. java pdf与ofd文件相互转换
  15. Magento Meigee-Glam 主题的用法
  16. win10计算器_30年的老树又开新花!新一代Win10记事本详细体验
  17. 心蓝12306订票助手
  18. 华为OJ——删除字符串中出现次数最少的
  19. 华为项目管理10大模板Excel版(可直接套用_非常实用)
  20. Java实现 稀疏矩阵乘积

热门文章

  1. 数据库的相关语句(where,order by)
  2. 通过编写串口助手工具学习MFC过程——(三)Unicode字符集的宽字符和多字节字符转换...
  3. Webpack + vue + es6 安装
  4. [验证码实现] Captcha 验证码类,一个很个性的验证码类 (转载)
  5. 在线base64加密解密工具
  6. Docker镜像、容器的理解和使用方法
  7. [PhoneGap]Mac下搭建PhoneGap开发环境
  8. VideoMemory, SystemMemory And AGPMemory
  9. 本週主題 -- Jakarta Commons Lang
  10. IDEA使用lombok时warn:Generating equals/hashCode implementation but without a call to superclass