从图像获取主导颜色丢弃背景 [英] Get dominant colors from image discarding the background

查看:109
本文介绍了从图像获取主导颜色丢弃背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是最好的(结果,而不是性能)算法从图像中提取主色。该算法应该丢弃图像的背景

What is the best (result, not performance) algorithm to fetch dominant colors from an image. The algorithm should discard the background of the image.

我知道我可以建立一个颜色数组,多少出现的形象,但我需要一种方法来确定的背景是什么,什么是前台,并只保留第二个(前景)记住,而读主色。

I know I can build an array of colors and how many they appear in the image, but I need a way to determine what is the background and what is the foreground, and keep only the second (foreground) in mind while read the dominant colors.

现在的问题是非常困难特别是对于渐变背景或backrounds有图案(非纯)

The problem is very hard especially for gradient backgrounds or backrounds with patterns (not plain)

推荐答案

从背景中隔离前景超出了特定的答案的范围,但...

Isolating the foreground from the background is beyond the scope of this particular answer, but...

我发现,应用像素化过滤器的图像将抽出一个很好的一套平均的色彩。

I've found that applying a pixelation filter to an image will draw out a really good set of 'average' colours.

我有时用这种方法得出的颜色的调色板与特定的情绪。我第一次发现与一般的色调我后我的照片,像素化,然后从产生的图像采样。

I sometimes use this approach to derive a pallete of colours with a particular mood. I first find a photograph with the general tones I'm after, pixelate and then sample from the resulting image.

(感谢此页面通过谷歌图片搜索找到的图像)

(Thanks to this page for the images found via Google Image Search)

这篇关于从图像获取主导颜色丢弃背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆