Show HN: Simple algorithm and color space to generate diverse skin tones
Show HN: Simple algorithm and color space to generate diverse skin tones
Show HN:用于生成多样化肤色的简单算法与色彩空间
What Colors Are We? Constructing A Good Enough Color Space For Skin Tones 我们是什么颜色的?构建一个肤色“足够好”的色彩空间
If you’re just looking for the results, below is a custom color picker based on the color space written in Javascript and a sample procedural generation algorithm in Python (Javascript equivalents are in the page source) - feel free to take this math and go have fun depicting our diverse world! The goal of this project was to define a color space that makes it easier to build inclusive color tools for a variety of contexts - such as character creators or digital art. If you see something here that sparks your curiosity, I would love for you to stick around and read below this section to learn more! 如果你只是想直接看结果,下方提供了一个基于该色彩空间的 Javascript 自定义取色器,以及一个 Python 过程生成算法示例(Javascript 等效代码可在页面源码中找到)。欢迎使用这些数学公式,去尽情描绘我们多元的世界!本项目旨在定义一种色彩空间,以便在各种场景(如角色创建器或数字艺术)中更轻松地构建包容性的色彩工具。如果你对这里的内容感到好奇,欢迎继续阅读本节下方的详细介绍!
[Code snippets omitted for brevity] [代码片段略]
Overview
概述
What colors are we? The short answer is maybe something like “brown” and the long answer is very, very long. Representing the broad range of human skin tones digitally is a hard problem. Often, a limited set of colors is presented as being good enough to cover the full spectrum of diversity. However, in using a specific set of colors, large groups of people are unable to accurately be represented, or might be unintentionally excluded. 我们是什么颜色的?简短的回答可能是“棕色”,而详细的回答则非常非常长。在数字世界中呈现人类广泛的肤色是一个难题。通常,人们会提供一组有限的颜色,并认为这足以覆盖多样性的全谱。然而,使用特定的颜色集会导致大量人群无法被准确呈现,甚至可能在无意中被排除在外。
The goal of this work is to identify the broadest inclusive range of colors in the RGB color space that correspond to plausible, but simplified skin tones. In particular, the aim was to identify simple, “good enough” equations which define that area, allowing the range to be used in a variety of contexts. Calling the equations “good enough” is intended to keep the limitations of this work at the forefront - the results are a useful starting point, but should not be taken to be authoritative. 本工作的目标是在 RGB 色彩空间中识别出最广泛、最具包容性的颜色范围,以对应合理但简化的肤色。特别地,目标是找到定义该区域的简单、“足够好”的方程,从而使该范围能够应用于各种场景。将这些方程称为“足够好”是为了时刻提醒人们注意本工作的局限性——这些结果是一个有用的起点,但不应被视为权威标准。
Introduction
引言
Although there have been improvements in the set of colors that are presented as representative of us, there’s still a gap that needs to be closed. Emojis say we’re 5 shades (or cartoon-yellow); a makeup brand might say 50; and a character creator might shrug and tell you to pick from all 16,777,216 options. If you look outside - or just at yourself - you’ll quickly notice that none of those can compare to the variety of reality; one person is not just one color. 尽管在代表人类的颜色集方面已经有所改进,但仍存在需要弥合的差距。Emoji 表情符号认为我们有 5 种色调(或卡通黄);化妆品品牌可能会说有 50 种;而角色创建器可能会让你从 16,777,216 种颜色中任选。如果你看看窗外,或者看看你自己,你会很快发现这些都无法与现实的多样性相比;一个人不仅仅只有一种颜色。
Despite that, it can be useful to try to boil things down to fewer values. The Unicode Consortium and makeup companies can figure out their own ranges, but I believe we can find a better solution that’s somewhere between “several” and “several million.” Taking the digital art world as an example, images such as the one below are often circulated in an attempt to assist other artists in identifying plausible colors. 尽管如此,尝试将事物简化为较少的值仍然是有用的。Unicode 联盟和化妆品公司可以制定他们自己的范围,但我相信我们可以找到一个介于“几种”和“几百万种”之间的更好解决方案。以数字艺术界为例,下图这类图像经常被传播,旨在帮助其他艺术家识别合理的肤色。
Limitations
局限性
Taking a step back to reality, this work has a number of inherent limitations. As mentioned before, skin tones are much more complicated than a single color. They vary widely between different areas of the body and are subject to complex biological processes. The perceived color of the skin is affected by blood flow, concentrations of melanin, complex scattering of light through the layers of the skin, as well as things like vitiligo, freckles, hyperpigmentation, scarring, and other common variations. 回归现实,这项工作存在一些固有的局限性。如前所述,肤色远比单一颜色复杂。它们在身体的不同部位差异巨大,并受到复杂的生物过程影响。皮肤的感知颜色受血流、黑色素浓度、光线穿过皮肤层的复杂散射,以及白癜风、雀斑、色素沉着过度、疤痕和其他常见变异的影响。
Secondly, a variety of health conditions can cause people to have skin tones that are well outside what might be perceived as plausible. Argyria can often lead to skin that is blue-gray in color; high bilirubin can cause skin to be yellowish or greenish. Additionally, it’s important to note that I am one person, not a researcher, and subject to my own general biases on top of my own perception of color. As far as I am aware I don’t have color vision deficiency, but a lot of the choices I made are completely subjective. 其次,多种健康状况可能导致人们的肤色超出通常被认为“合理”的范围。银中毒(Argyria)常导致皮肤呈蓝灰色;高胆红素血症可能导致皮肤呈黄色或绿色。此外,需要说明的是,我只是一个人,并非研究人员,除了对色彩的个人感知外,我还受到自身普遍偏见的影响。据我所知,我没有色觉缺陷,但我所做的许多选择完全是主观的。
Finally, colors are not perceived consistently across display types and viewing environments. RGB values look different between different screens, and people look completely different under different lighting conditions. Broadening this work to address some of these limitations would be an interesting area of further investigation - a goal of this project was to be good enough for simple use cases, but these limitations might be more problematic in other contexts. The results here will mainly be applicable in contexts that relate to generating simplified representations of people. 最后,颜色在不同的显示设备和观看环境下感知并不一致。RGB 值在不同屏幕上看起来不同,人在不同光照条件下看起来也完全不同。扩展这项工作以解决其中一些局限性将是一个有趣的后续研究方向——本项目的目标是满足简单用例的“足够好”,但在其他场景中,这些局限性可能会带来更多问题。此处的结果主要适用于与生成简化人物表现相关的场景。
Methodology
方法论
What are all of those numbers, and how did you get them? Content warning - unscientific methodology below. In other words: good enough is fine if you’re an engineer. 所有这些数字是什么,你是怎么得到的?内容警告——以下方法论并不科学。换句话说:如果你是工程师,“足够好”就够了。