Brien's Site

View on GitHub

Brien Dieterle

My Gallery My Videos My Projects

Problems In Painting

Contrast Effect

The 3 grey rectangles below are identical and have no color, yet the square on the left appears bluish, and the right appears reddish.

Contrast Effect

The illusion above is only noticeable because of the way the colors are arranged, however everything we see is being affected by this same exact phenomenon. Given what we know about Simultaneous Contrast, how are we supposed to mix and choose colors with a high degree of control when the actual tools interfere with the vision process?

Color Selection Tool Painter's palette Computer Palette

One option is to simply get used to it, and develop rules to help guide your color selections, and knowing that “nothing is what it is until it has a relationship”, as Richard McKinley says in the linked article. Corel Painter’s “Temporal Colors Palette” (below) seems to understand this somewhat, as it shows the new color superimposed on your painting as a round “swatch”. However, the interface with the vivid color wheel still imposes a significant Contrast Effect upon your color picking decisions, how could it not?

Corel Temporal Palette Corel Temporal Palette in context

It seems that it’s impossible to select a color from an interface without the interface also influencing the color selection. Does this explain our tendency to select rather overly saturated colors? Is this one reason why so many digital paintings “look digital”?

Why don’t we just get rid of the interface and allow the color selection to be influenced by the context within the actual painting? I should add, we don’t want to isolate our colors on some virtual palette on another monitor or in another universe: we want the contrast effect from our painting (not our interface or anything else) to influence our color decisions. To achieve this we can place little swatches of color directly on our painting; just like getting paint samples from the home improvement store! Except here, we can have unlimited swatches for free without getting the authorities involved.

interface-less color adjuster interface-less color adjuster

The only problem now is that the interface has to exist somewhere and be operable even when you’re not looking at it. Fortunately, we’ve long ago invented keyboards and other devices with whole arrays of buttons to choose from. We can map some buttons to adjust our colors in whatever dimensions we choose. Hue is an obvious dimension. What about brightness and saturation? Then it gets a bit more complicated.

Color Spaces

Most programs will give you color selectors in the HSV or HSL color space. There are many more models to sift through. The important thing for us is not what the wheels look like. Remember, we just talked about how the interface will blind you through the Contrast Effect. That includes any kind of color wheel. What we need is a color model that is intuitive and practical for the artist to use with a few buttons; “out of sight, in the mind”.

Traditional artists don’t (generally) think or work in terms of HSV, RGB, CMYK, etc. They work usually work in Tints, Tones, Shades, and Hue. HSV and many others don’t really seem to translate into this type of model. For instance, in HSV, the “Value” scale doesn’t actually go from black to white. Neither HSV nor HSL seem to give you Tones, either: a pure red will desaturate to “white” in the HSV model, while HSL will always produce a 50% grey tone no matter if you start with a pure red, blue, or yellow.

Fortunately, the HCY colorspace seems to map directly to these dimensions in a straightforward manner:

Below is the Y (luminosity) component, which directly translates Shades–>Tints:

Luminosity Ramp

Here, below, is the C (chromacity) component, which, as far as I can tell, is a great stand-in for Tones. A tone is supposed to desaturate to a grey color eventually– but not just a 50% grey or anything arbitrary. It should remain a consistent lightness. Notice how this yellow does not go to bright white, but rather a light grey:

Chromacity Ramp

Finally, below is H (hue). What seems like the most straightforward dimension is actually pretty complex. The HCY model trys to accomodate for how our eyes respond to light wavelengths differently. So, when you adjust only the hue you still have a color of similar brightness and chromacity. I started with Yellow, so all the other colors keep that same overall lightness: Hue ramp

Subtractive vs Additive Color Mixing

Perhaps the greatest hurdle facing digital programs’ approximation of physical pigment media is the fact that almost any program works in a method better suited for lights instead of paints. That is, light bulbs and lasers instead of actual pastel chalks, oil paints, acrylics, etc. In other words, it’s completely backwards and upside-down.

If you think you might be clever and force RGB into some kind of subtractive mode by simply multiplying your colors together instead of adding them, or switching RGB with RYB primaries. . . you’re going to have a bad time. Most colors will blend to horrible greys or even blacks unless you use precisely the colors Cyan, Magenta, and Yellow (RGB) or Orange, Green, and Magenta (RYB):

Subtractive Mixing

Scott Burns describes the problem in much more detail and, helpfully, provides a rather elegant solution. I can’t say I understand the math at all, but the premise is to essentially synthesize a plausible physical “pigment primary” for every possible color in the sRGB color space. That may sound impressive, having 16,777,216 pure pigments to work with. However, you would never go to the art store and buy a tube of pure “slightly beige off-white” paint to go with your collection of 50,000 very slightly different colored tubes of paint back home.

Rather, instead we have something quite a bit more than 360 tubes of paint, if you consider each degree on the wheel. I’m not even sure how to calcuate how many, but I’m sure it is in the thousands. This represents our color wheel of pure pigments.

So, instead of an RGB color like yellow, which is 1,1,0, we’d have an entire “reflectance curve” which is essentially the same thing except thirty-six numbers instead of three. This curve describes what percentage of light is reflected back to the eye for each 10 nanometer slice of the visible light spectrum. So, black would be all zeros (or very close to zero) and white would be a bunch of higher values, with some approaching 1.0 (even white light needs to have a “curve”, so it can’t be all 1.0). As Scott explains, there are infinite varieties of curves that could produce the same color, but nature seems to like “rounded off” curves that have gentle slopes. This formula to find these curves is among the gifts Scott has given us to make this work. Thanks Scott!!

The challenge is that it took my computer over a day to generate reflectance curves for the entire sRGB spectrum (256^3), so doing this real-time is not likely without GPU acceleration and much faster processors. Fortunately, we can precalcuate the whole thing before-hand, and store it as a text file. On disk it consumes 12GB of space, but “only” 2.4 Gigabytes of RAM when loaded. Fifteen or twenty years ago this would seem totally ludicrous, but today any mid-range computer with 4GB of system memory can probably handle this and still have some left over for actually, you know, making Art.

So now with this enormous lookup table loaded we can fairly quickly swap out RGB values with reflectance curves, mix them together “like paint” and convert that back to RGB again.

What difference does it make? One of the most striking examples to look at is blending Yellow and Blue. When you blend Yellow and Blue light, you actually arrive at a neutral gray or even white color. This is how many LED lamps work; a blue LED combined with a yellow phosphorus coating to combine to give you a normal-looking whitish light. This isn’t how most programs mix colors, though. For some reason that isn’t entirely clear, we are accustomed to mixing the colors without doing gamma correction, so our “mixed light” is darker than it ought to be. I get the impression this was a happy accident and computer programmers thought it looked “close enough” to some sort of true subtractive blending of pigments or inks.

Here now are three very different way to mix colors on the computer. From left to right. Linear Light Additive mixing, Typical Standard Additive mixing, and Scott Burns’ Subtractive mixing:

Mixing Comparison

Clearly, the subtractive mode is more familar and pleasant for anyone interested in painting. However, it’s not that additive mixing has no use. If you really want to paint rainbows, you probably want Linear Light additive mixing since you are literally trying to mimic light. Here’s a another comparison of a hue shift through HCY. From top to bottom we have Linear Additive, Standard Additive, and Subtractive:

hue shift image

Linear Additive stays very bright and vivid, while the other two modes are more dim. The Standard Additive and Subtractive modes don’t seem very different here, which is probably why the Standard Additive is considered “good enough” for most programmers and artists. Also, when doing a hue shift like this, we’re only blending adjacent hues. The benefits of subtractive modeling really start to show when you blend complementary or more disparate hues, or varying tints/tones/shades. Hopefully Scott Burns’ model will become the new “good enough” until we reach the next breakthrough in simulating pigments.