颜色之间的相似性 [英] Similarity Between Colors
问题描述
我在写一个程序,与图像一起工作,在某种程度上,我需要后化的图像。
I'm writing a program that works with images and at some point I need to posterize the image. This means I need to bin the colors, but I'm having trouble deciding how to tell how close one color is to another.
在RGB中给出一个颜色,我可以使用一个颜色来表示颜色。想想至少有两种方法可以看到它们有多不同:
Given a color in RGB, I can think of at least 2 ways to see how different they are:
- | r1 - r2 | + | g1-g2 | + | b1-b2 |
- sqrt((r1 - r2)^ 2 +(g1 - g2)^ 2 +(b1 - b2)^ 2)
如果我搬到HSV,我可以想出其他方法。
And if I move into HSV, I can think of other ways of doing it.
问,忽略速度,什么是最好的方式告诉如何相似的两种颜色?
So I ask, ignoring speed, what is the best way to tell how similar two colors are? Best meaning most accurate to the human eye.
推荐答案
看看这里
http://en.wikipedia.org/wiki/Color_difference
和
http://en.wikipedia.org/wiki/Euclidean_distance
这篇关于颜色之间的相似性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!