Show HN: Simple algorithm and color space to generate diverse skin tones (opens in a new tab)toneyalexander.github.io
627 pointsHello HN!
I found that picking out plausible but diverse skin tones for my digital art and game development projects was kind of difficult, and I got curious about if there was a way to define a color space that made it easy.
I've built a color picker and procedural generation algorithm based on the space as well as a bunch of other fun js features and demos throughout the page that use the equations. If you find it interesting, I have lots of explanations of how I built it and what properties the space has.
The methodology might be a bit shaky, but hopefully the result is as helpful for others as I have found it! There's lots of room for improvements (see the Future Work section), but I'm really happy with how it turned out.

Comments (99) 54 threads
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.
https://discovery.ucl.ac.uk/id/eprint/10093345/
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
Continue this thread — 4 replies
There is a separate effect of increased bilirubin content, that would appear if someone was ill.
Continue this thread — 2 replies
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?
Continue this thread — 3 replies
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.
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
The person inviting you to a picnic "next week" might need to know about Time Zones if they live some distance away. The requirement to update the CSS on the web site to match a new company logo might need to know about Colour Spaces. But that picnic invite doesn't care about Calendar systems or Leap Seconds, and the logo mandate doesn't care about Sub-surface scattering or a Quantum theory of light.
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.
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.
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.
https://www.youtube.com/watch?v=wh4aWZRtTwU
All comments shown.
Couldn't load more comments. Check your connection and try again.