我使用color thief从图像中提取调色板。在
如何创建rgb值的图像作为调色板?在
from colorthief import ColorThief
color_thief = ColorThief('C:\Users\username\Desktop\index.jpg')
# get the dominant color
dominant_color = color_thief.get_color(quality=1)
print dominant_color
# build a color palette
palette = color_thief.get_palette(color_count=2)
print palette
输出:
^{pr2}$预期输出类似于http://www.color-hex.com/color-palette/895,即一系列彩色矩形
使用Matplotlib中的
imshow
的解决方案:给出:
相关问题 更多 >
编程相关推荐