有没有一种简单的方法可以比较两种颜色之间的距离? [英] Is there an easy way to compare how close two colors are to each other?

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

问题描述

有没有一种方法可以比较两种颜色之间的距离?如果说它们都是蓝色。

目前,我们比较它们的方法是将每种可能的颜色手动分配给颜色系列(红色,绿色,蓝色...)。然后只需比较字符串即可:)

但可以肯定的是,可以将手动任务分配给一个整洁的小算法。

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.

  • CIE76
  • CMC l:c
  • dE94
  • dE2000

每件事都是以不同的方式进行的,但在大多数情况下,它们都需要您转换为比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.

Wikipedia具有所有公式: http://en.wikipedia.org/wiki/Color_difference

Wikipedia has all the formulae: http://en.wikipedia.org/wiki/Color_difference

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

You can check your work with online color calculators:

  • CIE76
  • CMC l:c

这篇关于有没有一种简单的方法可以比较两种颜色之间的距离?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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