有没有一种简单的方法来比较两种颜色彼此的接近程度? [英] Is there an easy way to compare how close two colors are to each other?

查看:23
本文介绍了有没有一种简单的方法来比较两种颜色彼此的接近程度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法比较两种颜色的接近程度?如果说它们都是蓝色的.
目前,我们比较它们的方法是手动将每种可能的颜色分配给一个颜色系列(红色、绿色、蓝色...).然后只比较字符串:)
但肯定可以将手动任务分配给一个简洁的小算法.

Is there a way to compare how close two colors are to each other? If to say both of them are blue.
At the moment the way that we compare them is to manually assign each possible color to a color family(red, green, blue...). And then just compare the strings :)
But surely that manual task can be assigned to a neat little algorithm.

推荐答案

Delta-e, 是单代表两种颜色之间感知距离"的数字.数字越小,颜色越接近人眼.

Delta-e, is a single number that represents the perceived 'distance' between two colors. The lower the number, the more similar the colors are to the human eye.

有几种不同的计算方法...CIE76(又名 CIE 1976 或 dE76)是最受欢迎的.

There are a few different ways to calculate it...CIE76 (aka CIE 1976 or dE76) being the most popular.

每个人都以不同的方式处理事情,但在大多数情况下,它们都要求您转换为比 RGB 更好(用于比较)的颜色模型.

Each one goes about things in a different way, but for the most part they all require you to convert to a better (for comparison) color model than RGB.

对于 CIE76,您基本上只需将颜色转换为 LAB 颜色空间,然后计算它们之间的 3 维距离.

For CIE76 you basically just convert your colors to the LAB color space, then compute the 3 dimensional distance between them.

维基百科有所有公式:http://en.wikipedia.org/wiki/Color_difference

您可以使用在线颜色计算器检查您的工作:

You can check your work with online color calculators:

这篇关于有没有一种简单的方法来比较两种颜色彼此的接近程度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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