facelessuser / coloraide-extras

Some extra color spaces and such for ColorAide
https://facelessuser.github.io/coloraide-extras
MIT License
2 stars 0 forks source link

Color Space: RYB #12

Closed facelessuser closed 1 year ago

facelessuser commented 2 years ago

I was considering implementing RYB, but I'm currently unsure.

  1. The most popular algorithm that is used at times is the one laid out by Gosset and Chen, which highly favors more paint-like colors. It doesn't actually have a true black, but kind of a very dark reddish color. It also doesn't contain the entire sRGB spectrum.

    It also isn't reversible. Well, I say isn't reversible, but with some extensive calculations, you could probably reverse it, there just aren't any that are readily available or at least none that cleanly round trip, and even if they did, they do not contain the full sRGB gamut. But I guess they are not attempting to, so 🤷🏻 .

  2. Another attempt that can be found is this one, which can only be found using the Wayback machine, though there are implementations using it here and there. This seems to do an okay job and is reversible. I'm not 100% sure about its accuracy, but there is no formal spec, so 🤷🏻.

  3. Another attempt is found in some scientific papers. It advertises the approach as being reversible and is similar to option (2.).

  4. There are numerous other attempts out there that are less common where people take on of the above approaches and try to "fix" them to meet the requirements they think they should meet.

Without an official spec, it makes it hard to really settle. Its main advantage is its ability to match (or more closely match) people's preference for it to mix color in a more paint-like manner. It's a funny little color space. I mocked up option (3.):

ryb

I'm not sure if I'm adding this, some other approach, or skipping it altogether.

facelessuser commented 2 years ago

Evaluating these a bit more. I've kind of decided that if we do RYB, we won't be doing the Gosset and Chen one. We can probably figure out how to reverse it if we really want, but it has a limited gamut, so not as useful

That would leave Arah J. Leonard and Sugita method. Top is Sugita, lower is Leonard:

Screen Shot 2022-05-02 at 8 18 53 PM

I'm not really sure which is "better". They both compress greens and blues, just to different degrees.

You can make either an additive or subtractive color space. When you think of paints, you are more thinking of a subtractive color space, but neither of these spaces are going to behave exactly like paint, though the Sugita one was used in some experiments to try to replicate acrylics and watercolors, etc. Some specialized compositing algorithms had to help to try and achieve acrylics. The watercolors weren't too bad though.

facelessuser commented 1 year ago

This will be handled on the main repo via: https://github.com/facelessuser/coloraide/pull/345. We ended up getting the translation of Gosset and Chen's approach working, and it has much nicer behavior.