Method of Spectral Optimization to Discover the Underlying Pigments in a Selection of Color Filters

Several months ago, as part of a term project in my graduate program, I was looking for a challenging problem, in a “new” area that I previously haven’t really worked in. And I wanted the problem to be “optimizer friendly” because I wanted to learn about numerical optimization. I settled on trying to answer the question “How are gels made?” Or really, I tried to answer “What pigments do they mix together to make gels?”

You might be thinking that’s not a new area for me. After all I’ve been working in and around LED lighting and displays for the entertainment industry for years. I’ve been involved with ESTA as a contributor on technical standards for much of that time. Gels can’t possibly be new to me. Well, in some sense., that’s true. I know what gels are and why we use them. I’ve even designed a few handfuls of shows using the trusty ETC Source 4 and a pile of questionably identified gels from the old gel bin. However, my technical expertise really lies in the design of LED products and LED drivers. I’m most familiar with a fundamentally different color mixing system than is active in the deployment of gels.

As you (hopefully) know, LED fixtures like the Chauvet Ovation series or ETC LED fixtures produce color by adding the light output from several LEDs. This is additive mixing. Red added to green makes yellow. Gels work differently. They are a physical filter that you place in the output beam of a light source and reduce transmission of some wavelengths. It does so, typically, by absorbing photons of the target energy (wavelength) and transforming that energy into molecular motion – heat. Thus they are subtractive. At least, I know thats the idea but I wanted to learn something more specific about gels and pigments. I’m not really familiar with models and mathematics that we use to understand the phenomenon at play in lighting gels and so it really is new to me.

The second part of my thought process was to look for a problem that’s “optimizer friendly” but still challenging. Numerical optimization is a technique in problem solving where you ask the computer “Why don’t you make a guess at a solution, and I’ll tell you how hot or cold it is.” Of course, as any kid knows it’s best to be very hot then very cold. And through this process the computer can slowly get closer and closer to the answer. It turns out, however, that it’s not quite so simple with the computer as it was when I was a kid. More on that later.

The question “How are gels made” or really “What kinds of, and how many, pigments and inks does LEE use to make gels?” is optimizer friendly because I can take a set of “possible inks” and see if they can reproduce the spectra of the gels very well. Some guesses might be very bad: when I calculate the “recipe” for a gel using some pigments, if the best recipe still sucks at making the gel then the pigments themselves aren’t very good. I can judge the amount of error as “hot” or “cold.”

Part I: The Gels

My goal is to figure out what the spectrum of the different pigments making up these gels might be. I’m also particularly curious about the number of pigments that are used. Since the LEE catalog has several hundred gels in it, it’s completely unreasonable to think that all of the gels are made from one particular pigment. At the very least, some gels are probably just darker or lighter variations of another. And yet, the reason for having so many hundreds of gels is actually because lighting designers choose gels specifically for special spectral properties.

Actually, lighting designers choose gels specifically because of how they make the performers’ makeup and facial expressions look, or the kind of details the lighting can bring out of the scenic painting. Lighting design, in event production anyway, is specifically about distorting the color rendering present in the scene. Blue is a particularly evocative example of this. There are many many blue gels available, and lighting designers seem to be fervent in their choices for specific blues that I’ve heard debates rage for hours. Some blues have a little more transmission in the long wavelengths. Some have too much. Some have none at all and are too saturated to be used for anything but highlighting. Some blues look like natural moonlight, some look like the moonlight I imagine in my heart.

Imagine a gel that cuts a lot of green light but leaves a lot of “pop” in the long wavelengths. That might really make that actress’s red lipstick glow during a sultry night scene. And some other situation, a quite somber speech in a courtyard, calls for a blue that is subtle, and maybe less saturated so it looks more like natural moonlight. Blue is so critical, and designers care so much, that there are several blue gels formulated in conjunction with and named after or for specific designers. LEE is so proud of these gels they dub them the “Designer Series” and you can see a list of gels and stories on their website. Given that there is so much effort to design specific gels, it is obvious then that LEE must have a somewhat complex set of pigments to mix from.

So to start, I need some spectral data of different kinds of gels. My original plan was to make measurements of my Rosco swatch book with a spectrophotometer. Unfortunately, that was right around when the covid shutdown started in the United States and I wasn’t able to get the lab time for this project that I wanted. So instead I had to see if I could make something else work. I painstakingly was able to download the transmission data from LEEs website, because they have the spectral transmittance distributions online. Shown above is almost all of the LEE Filter catalog, sorted by hue. There’s a lot of ambers and oranges!

Next. I need to come up with the pigment model. How do various pigments add together? If I have a gel that is 50% transmission and I put two of them together, the result is not 0%, but rather it’s 25%! And if I use 3 of them then the transmission is 12.5%. The underlying transmission is not adding together linearly. But rather it’s multiplicative. There is some interesting complexity here where the density of the pigment in the substrate acts the same way. It’s geometric. This is known as Beer’s law. Or sometimes by Beer-Lambert law and some other names. So rather than working with transmission, I need to calculate absorbance. There are some technical details about why this is and how interesting it can be but I won’t bore you with the details. Suffice it to say, that if I change to absorbance then I can use very simple additive matrix math. Really handy!

Absorbance is defined as the “logarithm of the reciprocal of transmission. Or A(\lambda)=log_{10}(1/T(\lambda)) Nice and easy! Only one small problem. Because of the precision of the data I was able to download, I had to throw out about 20 of the filters from the numerical process.

Part 2: The Hacking

Now we can ask the question: what principal components do all of these curves share? Using principal component analysis we can determine what the variation or shape of each curve has in common with each of the other curves. For example, in the pink graph above (middle left) each of these curves looks like it has about the same peak wavelength as each of the others. And in the top left it kind of looks like most of these have the same general shape, just more or less of the underlying pigment.

Unfortunately, principal component analysis, or eigenvector analysis only reveals the most mathematically significant underlying curves. They don’t have any real physical meaning. I.e. the first most important eigenvector isn’t necessarily a real possible curve. There are some physical constraints that we can assume are true for pigments. First, the pigments that are the principal underlying components of the system are all positive. There aren’t any pigments that emit light. They only have all positive absorbance. Second, none of these mixtures have a negative amount of pigment. It doesn’t make any sense for a gel to be made of 1 part A, 2 parts B and, -6 parts C.

Here is where the numerical optimization comes in. I’m going to ask the computer to use the eigenvectors and rotate them (rotate in 31 dimensional space – whoa) into something that is good at replicating all of the curves (has the least amount of error), has all positive curves, and has all positive mixtures. It turns out that it’s actually kind of hard to design such a complicated error function (the function that tells the computer how “hot” or how “cold” it’s guess is), and I’m going to skip over those details. But that’s the basic idea.

The next thing about the hot or cold game is that it’s kind of hard to play if you don’t have at least a reasonable place to start. Like if I told you I’ve hidden your locket somewhere on earth lets play the hot and cold game. It’s going to be very hard for you to even get to the lukewarm stage unless you have kind of a reasonable starting point. If I told you I’ve hidden it somewhere in Burbank. You have a much better chance at getting very hot. So we have to have a first guess. Again, I’m going to skip over some of the technical detail but what I found to be the best guess is to first come up with the best (“hottest”) set of 3 pigments and use that as the initial guess for four pigments. Then use the result of that optimization as the first guess for 5 pigments. Etc. etc.

After 40-50 hours of trying different kinds of error functions, guesses, fixing code, blah-blah science I finally got things to work nicely. In the video below “RMS” is a technical measure of the error and it’s short for “Root Mean Squared” error. In the bottom graph, which shows transmission, the RMS is in % transmission error. Lucky you that you get to see this condensed into about 1 minute, this video took an hour and a half to compute on my Macbook Pro.

So this process shows the computer’s BEST guess given some number of pigments. If there are 4 pigments, then the best possible pigments are the ones shown at 13 seconds. But this still doesn’t answer my question. How does LEE make gels?! From here on out, we have to rely on my intuition and qualitative science. “What feels like the right answer.” At this point it’s fair to say, 1) I did not fully answer my question. 2) It’s somewhat likely that the data which LEE publishes is intentionally inaccurate or manipulated to make this kind of analysis hard. 3) Some pigments, which are very expensive or special, might only be featured in one single gel. This type of analysis of the whole set will never reveal that kind of unique recipe.

Shown to the left are the “possible sets of primaries” at 4-9 pigments. At 8 and 9 pigments the error is very low, but the 8th and 9th pigments have many peaks. As the number of pigments was increased some of them became correction factors for specific wavelengths, having a very narrow absorbance bandwidth. In some tests, one of the pigments would become a single wavelength correction at 540nm. This is unreasonable for the types of pigments I assume LEE must be using, given the very low cost of most gels. Most importantly, it looks like the computer is just fitting noise in the data. Around 6 vectors the RMS error is not great so I’d like to see the system improve some from there.

The image above shows the best guess pigments for 4-9 pigments. Best 4 pigments is shown in top left, best 5 is shown in top right. Best 6 and 7 in the middle row. Finally best 8 and best 9 pigments shown on the bottom. Color is true to a mixture of 2 units used with a 3200K ERS.

Part 3: The Pigments, maybe.

At 7 pigments the computer gets a very nice looking set and the 7th pigment basically becomes a UV blocking filter. It makes sense that we would see some kind of UV / neutral density filter and since this first shows up with 7 pigments, I think that is the most likely answer.

Even at this level there is some evidence that the computer is just fitting noise in the data. This is not entirely surprising to see. There’s also something unsatisfactory about 7 pigments. There is no IR cut or true neutral density (grey, carbon) in the set I have revealed. I would think that these make an appearance in the real commercial process in place.

As for the amount of error, with the seven pigments shown to the left, the average error for making the LEE gels is about 4% transmission. Disappointingly high in my opinion. I would hope that with good input data the numerical methods I use should be able to come up with a much better guess. Perhaps when the lab opens up again and I can use our own high quality instruments I’ll try this analysis again.

Worst case analysis. In my last figure I thought it would be interesting to look at the gels that my analysis really fails to reproduce. If you had the exact 7 pigments above, and tried to remake every gel in the LEE catalog. The true gels are shown in color, my best theoretical reproduction is shown in black. These are the nine that would be the most troublesome. In the top left the total error is about 15% transmission. Others, like the top right have obvious issues. It’s only shown in faint grey, so I apologize if it’s hard to see, but in the top right one of the pigments has greater than 100% transmission. All of my pigments are all positive, so the only way to get greater than 100% transmission is to use a little bit of a negative amount of pigment. As much as my numerical tools tried to eliminate negative amounts of pigments, occasionally they would need to use a little bit of negative pigment in order to satisfy the goal to reduce error.


I hope you’ve found this analysis interesting, I certainly found the work fun. And difficult. As much as I’ve been educated about color and additive vs. subtractive mixing this project really made a few things click for me. First, once you start looking at pigments in absorbance it suddenly makes sense how they add together. For example, my third pigment, a broad absorbance band with a peak absorbance in the middle wavelengths, is magenta. It’s absorbing green photons and short and long (blue and red) photons are able to pass through. If I add that absorbance to the absorbances of the first and second pigments, both variations of cyan) then the resulting color would be kind of blue. Only short wave lengths.

I’ve known this for some time, but working on this project and staring at these absorbance curves really cemented my intuition about this. I think it was the act of looking at pigments or subtractive systems from the perspective of absorbance curves that really made the difference. I’m a bit embarrassed to say that at one moment during the work I kept thinking. “Why are all these pigments cyan and yellow! Red green and blue are primary!” I did eventually figure it out. I just didn’t have the same appreciation and intuition as I have now.

In the end this project is a failure. I’ve had to rely on very qualitative subjective analysis to say that there are 7 pigments in LEE filters. And actually, I already sense that that is incorrect. I think the most likely answer is that there are six saturated / colored pigments and 3 “neutrals”, an IR cut, UV cut, and Neutral Density for a total of 9 pigments. This is a part of the scientific method. Some experiments are failures, but you can still gain some insight into the hypothesis. Some results can’t easily be interpreted and, lacking sufficient statistical tools, we have to apply “scientific intuition.” Scientific intuition is that sense that, these results are improbable to explain the complete system. And why are they in probable? Well. For one, I think it’s safe to assume that a few gels probably have very special pigments and this type of analysis is not likely to succeed. And two, I know that I’m limited by the precision of the underlying data. There’s only so much I can do anyway. Scientific intuition is a powerful ally in trying to solve problems or figure out the next step. But it has a dangerous cousin: bias against contradictory results. It’s important to really think about if your “intuition” and assumptions are reasonable or if it’s just what you want to believe.

Finally, what about those pigments. What are they? Well, what I’ve done here is found the absorbance / transmission curves of the base pigments. To actually name them I would have to compare these curves to a reference database and see which real pigments they match most closely. An exercise for the reader.

Leave a comment

Leave a Reply