alt.hn

8/4/2026 at 3:16:22 PM

Show HN: Simple algorithm and color space to generate diverse skin tones

https://toneyalexander.github.io/inclusive-color-space/

by automatoney

8/4/2026 at 4:04:32 PM

This is beautiful work! First, I thought this would involve using PCA to go from 3D to 2D, which would result in an easier selector to use, but at the expense of representing every person.

Then, I thought this would stop at using the U-space vectors (the ones that form the basis of the PCA image) and their corresponding ellipse to form our color space, but no, the function fitting is a very slick idea, even if it was executed by hand.

Lastly, I love the presentation of sampling from different r values. Whether you sample from a fixed r value or a range of r values, I bet this has great applications in game design or animation.

I still don't quite get the manual data labeling process at the beginning? It seems like it would encode some bias, but the consistency of the first point cloud and the results certainly speak for themselves.

by vermarish

8/4/2026 at 4:20:37 PM

If you look at my doctoral thesis, in fact skin colour can be parametrised using melanin and haemoglobin concentration; which it means it is indeed (roughly) two dimensional. This allows you to invert the colour of a pixel and identify someone’s chromophore concentration. This is based on previous work of others cited in the thesis.

https://discovery.ucl.ac.uk/id/eprint/10093345/

by dr_scully

8/4/2026 at 4:45:22 PM

Oh goody, an expert in a question I've always wanted to ask.

Once upon a time, I encountered a sort of interactive museum book called "Earthsearch". One of its "exhibits" was a color wheel, made of two spinnable pieces of tinted acetate, that purported to be able to generate any skin tone. I suppose this is three degrees of freedom, since for any position of the two wheels you could access a range of colors around the edge - but the printed page underneath was simply a grayscale gradient, so one degree of freedom was simply luminance.

The book was released in 1994, and was very confident. It even went as far as to encourage the reader to see a doctor, should their skin tone not be achievable! What color model were they using?

by dTal

8/4/2026 at 5:25:15 PM

That’s sounds very interesting. I’m not sure. In the thesis, I generated spectral curves and transformed them using the light and camera sensitivity curves. So, in theory it could be used in any color space.

But I can’t vouch for the accuracy of the book, but I suspect it was an approximation.

The haemoglobin and melanin are roughly in separate layers of the skin. There is an approximation known as Beer-Lambert that models the skin as two semi-transparent layers. This ignores subsurface scattering, but is roughly correct.

So, in theory two acetate sheets might replicate this. That’s my intuitive opinion. It has been many years since I did this work.

by dr_scully

8/4/2026 at 5:11:29 PM

Oh man, that's a blast from the past, I think I had that book! Was that the one with an aluminum cover?

by mhink

8/4/2026 at 5:35:12 PM

That's it! They (rather dubiously) claimed it came from a recycled Russian coke can, if I recall.

by dTal

8/4/2026 at 4:26:28 PM

I've heard that the so-called "yellowish" skin color that non-tanned East Asians tend to have, is due to relative abundance of subcutaneous fat. If that's true, is that captured by the haemoglobin dimension or is it a yet another degree of freedom?

by GolDDranks

8/4/2026 at 5:12:26 PM

We used the approximation that the hypodermis was a perfectly white reflector; so the thickness wouldn’t matter. The collagen fibrills scatter light in such a way to create a yellower tint. So a person’s skin might appear this way in the absence of melanin and haemoglobin. I’m not an expert on population statistics, and so cannot give an opinion on specific skin types. Everything was based on ranges.

There is a separate effect of increased bilirubin content, that would appear if someone was ill.

by dr_scully

8/4/2026 at 5:58:13 PM

This brings up an interesting topic of atypical compounds that can visibly affect skin coloring -- whether temporary or more long-lived (such as elevated methemoglobin levels in the Blue Fugates of Kentucky).

It's fascinating to learn that melanin and haemoglobin are the two primary factors (and cover the vast majority of cases), but I'm curious how many other illnesses / disorders can produce compounds with visible effects.

Thank you for your posts on this thread -- I appreciate you knowledge-sharing on this!

by HanClinto

8/4/2026 at 6:15:46 PM

In theory, you can construct a skin model of any condition you want. It would be a case of knowing the concentration, scattering profiles and reflectance spectra of any chromophores. For the thesis, I wrote a Monte Carlo skin simulator using OpenCL, when it has just come out. You could plug anything in there.

by dr_scully

8/4/2026 at 4:53:52 PM

Not an expert, but when I was learning 3d modeling, there was a good chapter on subsurface scattering which affect the human skin rendering. It’s what give it liveness instead of looking like a doll.

by skydhash

8/4/2026 at 5:01:14 PM

All skin is slightly translucent, and color/tones forms a gradient across the surface of the skin. Your upper cheeks and forehead are usually slightly reddish, and the chin/neck are slightly bluish.

People only turn yellow if they have kidney or liver damage. However, some distinctive features like Lucy Liu's natural freckles are tough to draw right.

We looked around a lot for a procedural texture/shader to help make the project characters look less sickly, and please also consider supporting the persons work if you are able:

https://kuhantilope.gumroad.com/l/ultimate-skin

Best of luck =3

by Joel_Mckay

8/4/2026 at 5:36:14 PM

> People only turn yellow if they have kidney or liver damage.

This is not true. Roughly 5% of people have Gilbert's Syndrome which is genetic, metabolic abnormality where the bilirubin from dead blood cells are conjugated slower than the baseline patient leading to yellowing of the skin. It is not due to liver damage or disease and is a benign condition. Not to mention there is carotenemia from eating too many carrots or squash -- again not kidney/liver damage related.

by iwontberude

8/4/2026 at 5:49:14 PM

[flagged]

by Joel_Mckay

8/4/2026 at 7:19:03 PM

I didn't know chin/neck are slightly bluish, can we make it more explicit without side effects?

by CITIZENDOT

8/4/2026 at 7:54:57 PM

It is a classic artist starting off point to first drop a red/blue gradient as a base mixing layer, and add skin details/masks for each additional texture layer/feature.

The "The Ultimate Blender 3D Sculpting Course" covers several sculpting techniques, and while this course has a number of challenges it does cover several basics. Probably wise to wait for a sale event if interested.

https://www.udemy.com/course/blender-3d-sculpting-course/

Best of luck =3

by Joel_Mckay

8/4/2026 at 4:09:26 PM

Thank you! I call out the manual labeling bias and also that a future work improvement would be to be scientific about that labeling process (multiple labelers, expert labelers), and then to feed that into the equation generation steps. Part of where the "good enough" naming comes from - I was hoping that using my art brain and keeping a bunch of reference images in mind (shout out to the Humanae project) would maybe offset the bias a bit. But 100% right on the bias being there.

by automatoney

8/4/2026 at 5:35:36 PM

It's always entertaining to try to understand these things from first principles. Color and skin color in particular are very complex things to measure and model. It's not just a physical quantity, it's also a matter of human perception based on lighting and a host of factors.

It seems like some work was done to research existing approaches, but I don't see any reference to Pantone Skin Tones [0]. Without intending to, I've worked on 3 different projects which involved measuring skin tones for makeup applications. The Pantone range is not 100% perfect, but it's pretty well done and easy to understand. There are two axes: a light/dark one, and red-yellow one [1].

[0] https://www.pantone.com/na/en-us/skintone

[1] https://cosmeticsbusiness.com/pantone-skintone-guide-80945

by s1mon

8/4/2026 at 5:56:05 PM

There's also the Monk Skin Tone Scale by Dr. Monk and Google (available under a CC attribution 4.0 international license). It was developed for machine learning, so it's not exactly the same use case, but it provides 10 colors in a variety of formats, including hexadecimal. https://skintone.google/get-started

by ptmkenny

8/4/2026 at 5:56:10 PM

well its not a free as in beer color space

by zild3d

8/4/2026 at 6:55:13 PM

> What colors are we? The short answer is maybe something like “brown” and the long answer is very, very long.

Pete Shirley (author of Ray Tracing In One Weekend) is also a part time color scientist, and he clued me into the fact that if you crank the saturation to 100% of pictures of people of any race, the skin color comes out orange. I think I heard that some face detectors may work on this principle, but I don’t remember where I heard that.

by dahart

8/4/2026 at 7:44:09 PM

and brown is just dark orange.

by madcaptenor

8/4/2026 at 8:34:30 PM

Yes, true! Though cranking saturation doesn’t brighten colors (much… at least it’s not supposed to), and maybe interestingly, light brown isn’t quite orange. There might some asymmetry in color names.

So it might not be that surprising that dark skin people turn orange when sat is cranked, but perhaps slightly surprising that light skin people do.

Anyway, I suspect it’s computationally easier to turn everyone orange than brown. Plus, given that brown skin is already a category, orange could be useful terminology/category.

by dahart

8/4/2026 at 8:41:52 PM

And orange is just a yellow red.

by adamhartenz

8/4/2026 at 4:53:53 PM

Love it!

I was looking at this a little while ago, and used some of The Pudding's data on makeup/foundation shades (https://pudding.cool/2018/06/makeup-shades/) and plotted it into the Oklab colorspace (https://observablehq.com/@55th/foundation-shades). The shades form themselves into that same crescent as seen in the article.

by mbo

8/4/2026 at 4:57:02 PM

Woah I LOVE both of these! When I get a chance these are 100% getting linked from the writeup.

by automatoney

8/4/2026 at 3:58:59 PM

Nice. Most of these colors look right to me, but I'm also seeing green, blue and purple? If you're curating colors from the space manually then it's not a problem.

"Only realistic colors" would be a different problem. And I'm not sure if there's a way to solve that problem without excluding some real colors too.

(Maybe if the colour selector was a different shape? I don't know much about color spaces.)

by andai

8/4/2026 at 4:04:40 PM

Yes absolutely right on - I mention much deeper in the page that in a picker UI you can use a bigger range, but that in a generation context you might want to be a bit more selective. I go into it a bit more when I explain what R^2 is.

"not sure if there's a way to solve that problem without excluding some real colors too" - 100% right on that too. A big part of this work was to define a way to tweak/improve the equations in order to approach a solution to these issues - part of my hope in sharing is to get more eyes and brains thinking about this and proposing improvements!

by automatoney

8/4/2026 at 4:15:08 PM

I would have "show sphere" on by default--this kind of threw me at first, too.

This is a really nice project. Great work and a great write-up. Thanks for sharing.

by compass_copium

8/4/2026 at 4:13:16 PM

Reducing the R^2 value to ~1.5 excludes skin colors that are extremely blue, green and purple. That seems to be a happy medium between including real outliers and excluding colors like green.

by richiebful1

8/4/2026 at 4:08:32 PM

If you drag the bottom slider all the way to the right you only have plausible skin tones. Drag it all the way to the right and you can match skin tones for orcs, Na'vi and djinn

by wongarsu

8/4/2026 at 4:06:47 PM

Love it. I especially thought the introspective “aside” section on related resources was great, and I wish more people would show this kind of reflection.

by stephantul

8/4/2026 at 4:10:58 PM

Thanks! I hope to send lots of love those ways, they're basically all things that I found outside of this work that I liked enough to remember (I think Humanae was the one that I found while doing this).

by automatoney

8/4/2026 at 5:30:44 PM

I definitely don't speak for all non-white people when I say this, but personally I find people obsessing over it disturbing/offensive independent of whether their intentions are racist or anti-racist. I did find modeling/data-driven perspective cool though

by E-Reverance

8/4/2026 at 9:55:11 PM

You mention a bit about the latent social forces embedded within technological development and how that has related to skin tones and the technologies of color reproduction, so I figured I would share some references:

https://canopycanopycanopy.com/contents/color-goes-electric

The Kodak “Shirley cards” and test shots are of course famous in the media theory world for how they baked notions of race and “standard” or “normal” conditions into the medium of photography. Not dissimilar from the various discussions around facial recognition from approximately 10 yr ago.

by szvsw

8/4/2026 at 8:41:36 PM

I read the “limitations” section’s list of things that affect perceived skin tone and it didn’t mention lighting! This is pretty important as the available light determines the shades that can be perceived.

by rebuilder

8/4/2026 at 3:46:59 PM

This is super cool! I have always loved projects that try to categorize color space. Usually my work has gone in the other direction - isGray, isCloseToWhite, isPastel - but it's the same insofar as it's defining shapes like your matplot visual.

Wish I had this on hand like this three or four years ago when I was working on VR avatar software - we had hard-coded skin tone options at the time - would have been a cool addition!

by m_w_

8/4/2026 at 3:53:47 PM

In sharing this around I've found more people than I thought who've done things to semantically chop up the color space - definitely a more interesting area than I first thought of when working on my narrow use case. Feels like it'd be fun to play with something that has a whole bunch of different regions of color space labeled - like "here's where IsPastel overlaps with IsGreen".

But absolutely the hope is that this is a tool that stays accessible to people for whatever they're building and everyone can slow down on reinventing the wheel here for every character creator/digital art application.

by automatoney

8/4/2026 at 4:40:54 PM

Interesting though that the 1.5 setting (at least on my older iPhone) doesn’t really ever seem to cover the range of skin tones of indigenous Australians (“aboriginal” and Torres Strait Islanders), who apparently get their skin tones from a somewhat different expression of genes than other peoples with darker skin.

The 2.0 “outliers” cover those skin tones.

Masai and some Somali skin tones, similarly, look better represented by the outliers.

The full range of possible human skin tones is perhaps a bit of a challenge for technical colour representation, partly because diffuse reflectance seems to vary so much and that is hard to approximate on screen (e.g. as any website designer could attest, the difference between representing silver and grey is the use of highlights), though the representation of skin tones is a lot better than the early colour film era.

by dofm

8/4/2026 at 4:46:41 PM

Yes, 2.0 is the value I tuned the equations around - but I think there's definitely room for improvement in terms of squashing the space along the fair/deep axis in order to get better results at lower R^2.

The issue I ran into was what happens when the space moves beyond RGB, but I think the fix is to just add clamps to the end R, G, B values.

by automatoney

8/4/2026 at 8:46:38 PM

I'm using an iPhone Safari plugin called Noir to force darkmode and your tool is making white the absence of color. In other words, I think white is just an alpha channel.

by 1-6

8/4/2026 at 7:04:37 PM

I think it’s worthwhile to note this is under a light with a color temperature similar to sunlight.

When you’re actually painting, skin can really be any color. Blue is a perfectly valid (and fairly common) skin color - just look at someone in the moonlight. It takes two to tango, and the other dancer is the light source.

by stu2b50

8/4/2026 at 4:54:37 PM

Skin tones are particularly difficult to pin down, besides the pigmentation there are two effects at play: 1) sub surface scattering (light goes thru and bounces under the skin a bit) and 2) some infra-red emission (the responsible for making some people appear magenta on digital photography)

So even when you get the palette right, to paint it like a believable material in a convincing way is still super hard!

by manoDev

8/4/2026 at 4:53:26 PM

This part ( https://toneyalexander.github.io/inclusive-color-space/#pick... ) is especially cool.

Would love to see this 3-D picker ability in the many character designers out there, instead of the lame 8 swatches or whatever.

by xp84

8/4/2026 at 5:49:01 PM

I think the ideal would be to use this picker to select a few tones, and then gradient map those across different parts of the body according to a grayscale map. Then you could fine-tune things like palm color, cheeks, facial tone, etc. individually.

by barbecue_sauce

8/4/2026 at 8:41:00 PM

I really like the idea of treating a color space as a task-specific optimization rather than something universal. It makes me wonder if we're underusing domain-specific color spaces in procedural generation in general.

by peepsick

8/4/2026 at 6:34:38 PM

The U and V axes seem roughly correspond to the tint/temperature (green-magenta/blue-amber) axes that you can find in a white balance tool in photo editors and also as an in-camera setting.

Nb. I'd advise against calling the PCA'd space XYZ because that's a well known standard color space: https://en.wikipedia.org/wiki/CIE_1931_color_space#CIE_XYZ_c...

by Sharlin

8/4/2026 at 7:48:01 PM

So glad to see Nyma getting recognition! I went to elementary and middle school with her, happy to see her succeeding.

by kaitlinseng

8/4/2026 at 4:27:57 PM

I love this! Such a beautiful use of some real nerdy math to benefit humans in a way non-nerds would appreciate.

by PullJosh

8/4/2026 at 4:31:16 PM

Very neat project. Could I use this code to generate skin tones in my own project? Or more meant to just be educational/inspirational? I guess I'm wondering if you've considered adding a license.

by rrradical

8/4/2026 at 4:38:15 PM

Good catch, added MIT license - feel free to use it! On top of that, my understanding is that math/equations are not subject to copyright, so the core part of this work (the equations/ideas) I think legally has 0 limitations - even if there were a restrictive license. But IANAL so might have some misconceptions.

by automatoney

8/4/2026 at 4:04:40 PM

For anyone confused, turn off your dark mode extension. :)

by RIMR

8/4/2026 at 4:12:00 PM

Oh wow, didn't even think of how that sort of thing might affect the page.

by automatoney

8/4/2026 at 4:23:31 PM

On the movie Dolemite by Eddy Murphy, they go over the fact that black people absorb light and white people reflect, and how that changes the motion picture shooting process totally. Also how one size does not fit all. Cool project! I am not much into the humanities part of the project. For me this is as natural as having a localization framework, just in this case for skin tones.

by ptsneves

8/4/2026 at 4:44:51 PM

Never seen anyone #E6FFF8 (bottom right corner).

An albino that consumed too much colloidal silver for years?

by efitz

8/4/2026 at 6:01:35 PM

Setting R² to various large values like 50, 500 and 5000 then moving the slider around seems to give a decent and simple visual representation of what's happening.

by zetanor

8/4/2026 at 4:13:12 PM

This is excellent work! You’ve got a 49 year old and a 10 year old equally into it. That’s impressive - nice work.

by hluska

8/4/2026 at 7:12:48 PM

Me after I spend a day at the beach: #BA3A17

by JacobAsmuth

8/4/2026 at 5:08:27 PM

Not my domain though I followed the data science enough to nod as if I really followed it,

but this is just lovely and inspirational work. A unique marriage of hacking in the celebratory sense, thoughtfulness, and meaningful contribution. Outstanding.

by aaroninsf

8/4/2026 at 5:18:25 PM

Wow what a touching compliment, thank you so much!!

by automatoney

8/4/2026 at 4:34:55 PM

Skin is so interesting as a surface to think about how light passes through and bounces off of.

There is at least one article published by a technical artist at Pixar who describes modeling a skull within a human scan so that subsurface lighting is more accurately rendered.

I suspect you could combine this with dr_scully’s comment and GolDDranks’ to reach the nuance involved in long tail realism details.

by bellowsgulch

8/4/2026 at 4:49:57 PM

There's a lot of really good research papers that touch on this area from what I saw - would definitely be cool to see if that extra nuance could be added without dramatically increasing the math complexity; in its current state, the code could be used in any programming language without a library.

by automatoney

8/4/2026 at 4:00:08 PM

Cool work!

by Abh1Works

8/4/2026 at 5:07:40 PM

If you're ##CCFFFF please go to the hospital

by ralusek

8/4/2026 at 5:47:41 PM

Very interesting, I'll need to read it again lol

by uhdozo

8/4/2026 at 3:52:00 PM

[dead]

by tyromaniac

8/4/2026 at 9:17:40 PM

[flagged]

by juleiie

8/4/2026 at 3:58:22 PM

[flagged]

by moralestapia

8/4/2026 at 4:03:30 PM

...Did you read the article, or use the picker? It's a continuous (up to the limits of RGB quantization) space which includes thousands upon thousands of shades of black. The selected tones at the top of the article are random and change continuously.

by Tossrock

8/4/2026 at 4:17:38 PM

[flagged]

by 4848489449

8/4/2026 at 4:54:43 PM

[flagged]

by noobahoi

8/4/2026 at 6:17:16 PM

[flagged]

by nahidmahmud555

8/4/2026 at 5:17:01 PM

[flagged]

by drnick1

8/4/2026 at 5:38:24 PM

[flagged]

by richard_chase

8/4/2026 at 5:41:47 PM

> Why do you need diverse skin tones for your art?

> It's your art, you can choose whatever skin tones you wish.

This is pretty self evident, no?

by dshoemaker

8/4/2026 at 5:44:59 PM

No. They're free to choose diverse skin tones if they want, but they presented it as if they don't have a choice.

by richard_chase

8/4/2026 at 6:57:09 PM

They did not present it “as if they don’t have a choice”. I think your personal biases are impacting your reading here.

by kentm

8/4/2026 at 8:51:48 PM

[flagged]

by richard_chase

8/4/2026 at 9:01:33 PM

And your whole post screamed desperation for everyone to know you're a racist troll who can't stand it when people don't hate diversity as much as you do.

Maybe he just wanted foaming-at-the-mouth racists to disapprove of him and throw furious temper tantrums, and he's thrilled that you performed on cue.

Tell your therapist that today you chose a skin color selector as your hill to die on, and they'll take it from there.

They'll probably prescribe you some lithium -- straightjacket in a pill.

Edit: If I got you all wrong, then why did you flip out irrationally and start making unfounded accusations about the motives of the author? You need to get help, if that's what sets you off and makes you throw temper tantrums and insult people's motives as if you had any idea what they were thinking.

You're the one injecting politics into this. When you find yourself parroting Donald Trump and aligning with White Supremacists, you really need to stop shouting at people for "shoving things down your throat" when they're doing no such thing, and question where you're getting your beliefs from, and why you're getting so irrational and emotional and accusatory and downright toxic about it. Oh no, he linked to a black woman's youtube video, he's trying to annoy you and Donald Trump by virtue signaling, and shoving black women down your throat!

I come here for tech, not assholes like you trying to make everything political and throwing irrational temper tantrums about it.

Chill out, dude. It's only a skin color selector.

Edit 2:

>Well you've insulted me like 50 times, so I think you're the one who should chill, my good sir. All I did was ask a couple of sincere questions and I'm met with a barrage of insults, yet no answers. Interesting. Also, I honestly have not heard or read anything Donald Trump has said in years.

"Honestly", huh? I don't believe a word of what you're saying.

by DonHopkins

8/4/2026 at 9:14:50 PM

You've got me all wrong. My problem is not with diversity per se, but people who feel the need to shove diversity down everyone's throat. Virtue signalling, I think they call it. I come here for tech, not politics.

by richard_chase

8/4/2026 at 9:42:31 PM

Well you've insulted me like 50 times, so I think you're the one who should chill, my good sir. All I did was ask a couple of sincere questions and I'm met with a barrage of insults, yet no answers. Interesting. Also, I honestly have not heard or read anything Donald Trump has said in years.

by richard_chase

8/4/2026 at 6:39:21 PM

It's pretty self evident that you're a racist troll by how easily and emotionally triggered you are by diversity, so the color of your skin is dark green.

by DonHopkins

8/4/2026 at 8:53:53 PM

[flagged]

by richard_chase

8/4/2026 at 8:59:23 PM

I'm not talking about everyone, I'm talking about you, and your own words.

And you certainly go out of your way to let everyone know you are.

Get some therapy if you can't deal with people having different color skin than yours.

by DonHopkins

8/4/2026 at 8:12:49 PM

A reporter once asked the Picard actor why his character is bald. Surely, they would find a cure by the time humanity figured out space travel. The actor countered saying that by the 24th century they would have stopped caring about such trivial things.

Similarly, you'd think that as people got less racist they would stop caring about skin color. Instead, the left is obsessed with skin color. We used to have a single emoji skin color representing all of humanity. Now we have 6. Presumably OP thinks that's too few. We used to have a single emoji for pregnant women. Now we have 18. 6 for women who identify as men, 6 for women who identify as non-women, and 6 women who don't identify.

by xdennis

8/4/2026 at 8:28:55 PM

I just think it's highly amusing (in the absurd sense) that you consider a visual artist to be a political ideologue simply for applying color theory to render realistic characters in their art.

by BHSPitMonkey

8/4/2026 at 4:03:08 PM

Seems to underrepresent pale skin tone variety

by 383toast

8/4/2026 at 4:26:14 PM

Turn off your dark mode reader extension

by LocalH

8/4/2026 at 8:30:29 PM

Under-represent relative to what, exactly?

by BHSPitMonkey

8/4/2026 at 4:52:24 PM

This hits different after a long week

by hneqy2wqls