Hacker News new | past | comments | ask | show | jobs | submit login
On light, colors, mixing paints, and numerical optimization (github.com/miciwan)
190 points by ibobev 10 months ago | hide | past | favorite | 21 comments



Absolutely love this.

I've been getting into mixing for miniature painting myself, but with a bit of added perspective which (I think) isn't captured here.

It turns out there's more than just raw color going on here. Acrylic paints have different degrees of opacity, and you can increase transparency by mixing in acrylic medium. Additionally, adding water and/or flow-improver helps the acrylics slide off flat surfaces into crevices, producing deeper colors in recesses and thinner applications in open areas - this is the principle which gives us washes, shades, and contrast/speed paints.

And there's basic acrylic mediums (matte or gloss) but also specialty mediums which have more texture (gels, modeling pastes) or additives (pumice, fiber, glass micro-beads). [Edit: And of course, Metallics!!! There's a few different additives, like mica, which are used to create metallic paints.]

Together, this points to a combinatorial problem: No pre-mixed bottles will ever cover all of the possibilities, so you have to start mixing paints (and mediums!) to achieve the desired effects in any particular project.


Indeed. I learned color theory from "The Measurement of Appearance" by Richards Hunter and Harold, and one of the strengths of that work is that goes well beyond simple color into things like gloss, opalescence, etc. Highly recommended.

Also Bruce MacEvoy's in-progress book "Color Experience"[1] looks like it will be a fairly definitive treatment of the topic. It is also rooted in physical colorants (the author is an extremely serious watercolorist).

[1]: https://www.handprint.com/CE/book.html


I've been using various paints (watercolour, gouache, acrylic) and various mediums (gum arabic, aquapasto, gloss gel medium) on (paper, canvas, gesso) to paint repeating patterns. It's interesting how much experimentation you have to do to learn about a particular paint or combination of paint and medium.

Sometimes I think combinations will have _more_ of an effect - I was hopeful that ink on paper below gloss medium acrylic would be more obvious, but did not come out the way I expected.


I know an artist who is an expert of mixing colors and lightning. He spend his whole life mixing colors. In the past decades he created several color palettes to be use inside and/or outside buildings [1]. In 2013 and 2014 he created 21 works (consisting of pairs of paintings) that contain color palettes experimenting with variations of brightness and saturation of six evenly passed colors [2]. In 2020/2021, he created eight works with color palettes existing of twelve even passed colors with the same brightness and saturation (by daylight) [3].

He complains a lot about lightning in museums, that it deviates a lot from daylight, while many works of art are create by daylight. The light is often too yellow, based on some 'dubious' research that museum visitors prefer yellow light. LED lightning often causes mixtures of pigments that look the same under daylight to look different under LED lightning. LED lightning often is rather weak in the infra-red to red part of the spectrum cause most reds in painting to fade. He found a combination of a reddish and a blue TL-lamps supporting to LED lights to give a better approximation of daylight. When this was applied to some museum rooms, the son of a man who donated a work, asked what they did with it work as it looked again like how it looked at their home when it was hung close to the windows. (Shortly after this the museum director decided to use only LED lightning for the new wing that was going to be build.)

The problem of course is that we are so used to adapt our color vision to the lightning that most people do not see the difference. I guess that people who mix colors all the time, develop some kind of absolute color vision and do notice the effect of improper lightning on art works.

[1] https://www.pstruycken.nl/EnDyn.html?Li,tag=q&w

[2] https://www.pstruycken.nl/EnS14.html

[3] https://www.pstruycken.nl/EnS20.html


For all classical works, I reckon there’s no question the light they were created under would be some variant of black-body radiation: sun, incandescent bulb, fire. The distinguishing part of black-body radiation is that its spectrum is continuous throughout.

Compared to incandescent lamps, fluorescent sources including LEDs emit spectrum that is bumpy or even spiky. Those spikes fall within R, G and B and the resulting light looks white itself; but the objects or paints from which it reflects may not look the same[0]. At extremes, depending on what the paint is made of (not simply its colour!), the picture may look very different.

(Ever noticed how you may admire an amazingly vibrant flower in the field, but no photo seems to reproduce that brilliance? That’s another example of metameric failure.)

To see a work of art how it was intended to look, you should view it under the light it was created in. Unfortunately, it appears impossible to break from the shackles of LED these days. Depending on where you live, it may actually be impossible to source a tungsten filament bulb. You’d think it should be easy and worth the extra electricity expense to the management of any good gallery or museum, but apparently not.

[0] See: https://en.wikipedia.org/wiki/Metamerism_(color)#Metameric_f...


> LED lightning often causes mixtures of pigments that look the same under daylight to look different under LED lightning.

I'm surprised that this extremely cool phenomenon is not embraced by artists and exploited as an essential part of their language. For example, they could use pigments with bizarre absorption spectra/fluorescent properties, so that the same painting looks completely different when put near a sunny window or under a led lamp.

Focusing only on color rendering under daylight seems a bit short-sighted, now that we master all sorts of synthetic lighting and fancy chemistry.


It’s a technique used heavily in psychedelic art and set design for festivals and events, particularly before projection mapping became the norm. When there’s spectral control of the lighting source this can be varied to bring out extremely contrasting detail in a surface or set of surfaces. As with most techniques its usage can range from pure gimmick to beautifully executed mastery.


> to beautifully executed mastery

Imagine a Mona Lisa that only smiles in a cloudy evening!


Imagine a landscape painting whose sky always reflects the current weather and time of day!


Easy, just use a mirror!

But what about the opposite? A sunny landscape when it's cloudy outside, and a cloudy landscape when it's sunny?


There are some artists who do and IMO they’re rather gimmicky. Not sure how widely shared that view is.


You can get a decent idea of the color shifts from an LED light’s spectrum if the manufacturer publishes TM-30 data for it. This attempts to compare color rendering similarity vs a reference illuminant, based on 99 spectral reflectance distributions representing a variety of objects that might be illuminated. The standard has been around since 2015, but unfortunately many LED light manufacturers still don’t provide this.

The spectrum data gets boiled down (or not) in a couple of ways:

1) Rf, or “fidelity index” where a score closer to 100 means it renders colors more similarly to how they look under a reference illuminant (which standard illuminant is used for comparison depends on color temperature). But as you summarize more information down to fewer values, you of course get less detail - many different spectrums could provide an Rf of 95, with different visual effect. Rf only gives you an idea of whether the visual difference between this light source and the reference illuminant will be large or small. It’s a similar concept to “CRI” scores if you’re familiar with that, but based on a much better set of samples, and not as easily gamed for a high score by carefully designing an LED’s spectrum to correctly render CRI’s more limited set of color samples.

2) Color vector graphic, shown on page 28 of the PDF linked below, shows a smushed circle which broadly illustrates how different hues are shifted. For example, reds might be undersaturated and shifted toward orange. This is still summarizing, not all red objects will have the same shift, depending on their precise spectral reflectance distribution and the source’s spectral power distribution. But it gives a better idea of how the light will look than the Rf alone.

3) Color sample vectors shown on page 24 of the same PDF, which shows each of the individual 99 spectral reflectance samples used for TM-30 and how it will shift compared to when viewed under the standard illuminant. The color vector diagram in point 2 is a summary of these, but if you want more detail you could see them individually. I’m not sure anyone actually publishes this since these particular 99 samples aren’t likely applicable to whatever you’re doing. And ultimately it’s still not the full story, because this is all based on 99 specific color samples attempting to be a representative spread of materials you might encounter in the real world. But 99 samples certainly can’t represent all materials. To get real answers you’d need to go down the same rabbit hole that the article did and measure the spectral reflectance of every object you’re lighting.

https://www.energy.gov/sites/default/files/2022-04/ssl-royer...


As a painter, this is both amusing and terrifying to read.

There are simple ways to conceptualize color mixing, for example the primary model, or HSV. Of course, those are models, so they don't capture everything, as mentioned ITT (e.g. transparency, lightfastness, texture, potency, price) but they're practically good enough.

For example, in a primary (+white) setting, a given mix can only:

- not have enough red

- not have enough blue

- not have enough yellow

- not have enough white

So the only questions one can ask is: "does it need more red/yellow/blue/white?", period. If one has more than those 4 colors, then the trick is to understand them in terms of red/blue/yellow/white: one is then left again with those 4 questions.

I've found HSV more practical than RYB, but people are generally accustomed to RYB, hence why I've described it instead; the general idea really is the same: only a small, finite number of mistakes.

It's simple, but it still requires a few hours of practice until it becomes intuitive, especially with "real world" pigments.


What a wonderful and detailed wrote up. Thank you for this! I wrote something similar but never released it due to not having a lot of hobby paint colors to include. It uses LAB for linear distance as a scoring mechanism and reflectance curves from RGB for the mixing. And a genetic algorithm for finding a recipe.

Here's a short video of an older version. Newer one let's you set how long to search for.

https://youtu.be/eGgrowt1fWg?si=NwucIgfpeWpbmCPX


Nice description! For project of this type that has been going for 20 years, and covers many different paint sets, see https://zsolt-kovacs.unibs.it/colormixingtools


    Light is therefore color, and shadow the privation of it by the removal of these rays of color, or subduction of power;
    and these are to be found throughout nature in the ruling principles of diurnal variations.
    The grey dawn, the yellow morning and red departing ray, in every changing combinations, 
    are constantly found to be by subduction or inversion of the the rays of their tangents.

    -- J. M. W. Turner, 1818.

https://archive.org/details/colourinturnerpo0000gage/page/11...


Colours are the deeds of light; its deeds and sufferings: thus considered we may expect from them some explanation respecting light itself.

J. W. Goethe, preface to The Theory of Colour, 1810


The article reminded me of Mixbox (https://scrtwpns.com/mixbox/), which implements pigment-like mixing of colors aimed at digital painting.


Such a nice surprisingly thorough overview (nice diagrams too!)


This is a lovely exploration of color. Thank you for sharing.


Nice write up from a technical/engineering perspective however it has some notable gaps on the color 'perception' side.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: