颜色重映射 - 使用 3D 网格匹配目标调色板? [英] Color Remapping - Matching target palette using a 3D grid?

查看:18
本文介绍了颜色重映射 - 使用 3D 网格匹配目标调色板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有颜色FOO",它以 RGB 格式存储.我需要重新着色FOO",使其与颜色列表中最接近的颜色相匹配.即时执行此操作,我不能将每种颜色的 RGB 值视为 3D 网格上的点(r=x、g=y、b=z)并计算点FOO"与每个点之间的距离吗?列表中的颜色?

Let's say I have color 'FOO', and it is stored in RGB format. I need to recolor 'FOO' so it matches the closest color in a list of colors. Doing this on the fly, couldn't I view the RGB values from each color as points on a 3D grid (r=x, g=y, b=z) and compute the distance between point 'FOO' vs the points from each color in the list?

最接近FOO"的点是替换颜色?

The closest point to 'FOO' would be the replacement color?

推荐答案

理论上,是的.实际上,如果您想做得好,计算最接近的颜色并非易事.举个例子,人们的眼睛对亮度变化比颜色变化更敏感,尤其是在颜色范围的末端(即,极端红色或蓝色).

In theory, yes. In reality, computing the closest color is non-trivial if you want to do it well. Just for example, people's eyes are much more sensitive to changes in brightness than color shifts, especially toward the ends of the color range (i.e., toward extreme reds or blues).

至少如果你不介意计算中的一些额外工作,你会想要使用标准的"delta E" 计算(在您的情况下,您需要最小化 delta E).请注意,所有这些(无论如何我都使用过)在 CIE Lab* 色彩空间中工作.在典型情况下,您将从 RGB 开始,您需要将其 转换为Lab* 首先.

At least if you don't mind some extra work in the computation, you'll want to use one of the standard "delta E" computations (in your case, you'll want to minimize delta E). Note that these all (all I've worked with anyway) work in the CIE Lab* color space. In a typical case, you'll start with RGB, which you'll need to convert to Lab* first.

这篇关于颜色重映射 - 使用 3D 网格匹配目标调色板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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