当前位置:柔美女性网 >

绿色生活 >心理 >

Python怎么提取图像颜色

Python怎么提取图像颜色

Python怎么提取图像颜色

答:Python提取图像颜色的方法如下:

# -*- coding: cp936 -*-

from ctypes import *

#引入winapi

gdi32 = 32

user32 = 32

#获取句柄

hdc = C(None)

#获取指定像素的颜色

c = ixel(hdc,100,50)

#打印十进制转化为十六进制的颜色

print hex(c)。

仅供你参考。

标签: 图像 提取 python
  • 文章版权属于文章作者所有,转载请注明 https://rmnxw.com/lvse/xinli/jqdoo9.html