thomasp85 / farver

High Performance Colourspace Manipulation in R
https://farver.data-imaginist.com
Other
125 stars 14 forks source link

Implement paint mixing simulation #11

Open thomasp85 opened 4 years ago

thomasp85 commented 4 years ago

https://stackoverflow.com/questions/1351442/is-there-an-algorithm-for-color-mixing-that-works-like-mixing-real-colors

dylanbeaudette commented 4 years ago

Some ideas related to reflectance curves for Munsell chips or sRGB values

teunbrand commented 2 months ago

Aside from the elaborate mixing mentioned in the posts above, it would also be nice to have a straightforward colour mixing/interpolation function (in some space) without the need for simulation. This can already achieved manually, but it might be useful for https://github.com/r-lib/scales/issues/423 to have that extra farver magic.

dylanbeaudette commented 2 months ago

I've been thinking about wrapping this code into an R package, unless @thomasp85 is interested in putting it here...?

https://github.com/scrtwpns/mixbox

The mixbox approach is really interesting because it can closely approximate a subtractive mixture without any simulation.

Currently, there is support for the simulation of subtractive color mixing the the aqp package, but only for colors referenced in the Munsell system and having reflectance spectra. I plan to add more reference spectra in the future. Even so, simulation is expensive and the R implementation isn't very fast.

image

thomasp85 commented 2 months ago

I'm very interested in having it here. One thing to be super careful about is the licensing of the various pigment mixing approaches as I remember them to be very restrictive. It seems mixbox is CC-NC which seems fine but better check. Often there is copyright on the reflectance data

dylanbeaudette commented 2 months ago

Great! I've had some fun conversations with the mixbox authors and they have been very supportive of its (non-commercial) use. I'd be happy to help with testing and or documentation. Compiled code isn't my specialty.

I'm planning to further develop the Munsell / reference spectra based mixing in aqp, as it is mostly concerned with "small mixes". In addition, I'm planning to add diffuse spectra for a simulation closer to that outlined by Kubelka–Munk.