Infinity Color Masks: A closer look

First off, a big THANK YOU for the positive feedback on the new infinity color masks. They seem to have resonated with a large number of photographers. Also a big thanks for the questions that were sent. I can see there is some interest in better understanding these masks and how they work. In this blog, I’ll look at three sample images using well defined colors to explain what’s going on when you make an infinity color mask. NOTE: This gets a bit technical, so I put the main points in bold-face type if you want to just skim through.

Color is defined by three values: Hue, Saturation, and Brightness, which are the three values in the HSB color model, and all three can be extracted using Photoshop’s Color Picker. All three are also part of an infinity color mask. The initial Color Picker selection extracts the Hue from the sampled area and this Hue is the foundation around which the mask is built. The gray values in the mask are then determined using the Saturation and the Brightness of pixels that match the chosen Hue. That’s the basic idea of how an infinity color mask is made.

Of course, the actual infinity color mask provides additional options. For example, it’s not limited to a single Hue value but instead creates a mask that encompasses a range of similar hues around the sampled Hue, and there is also a hue-based transition zone from the defined Hue range into nearby hues. Additionally, I’ve cranked up the mask’s lightness since most “normal” photographs produce relatively dark infinity color masks that would be hard to evaluate on-screen. But the exaggerated lightness adjustment does not affect the relative lightness within the Hue range being selected by the mask, except for unusually saturated colors, in which case the mask’s overall lightness can easily be turned down to properly restore the relative pixel lightness. In all cases, though, the infinity color mask is constantly and accurately adjusting with each image to take Hue, Saturation, and Brightness into account for what was sampled from the image.

In the first example below there are three different blue colors−a light (but unsaturated) blue on the left, a darker (and more saturated) blue in the middle, and a lighter blue on the right (with the same Saturation as the middle square). These colors differ only in Saturation and Brightness. They are all the same Hue: Hue = 206 degrees in the Adobe RGB color space. That means that no matter which color square is sampled to make an infinity color mask, the initial mask will be the same. Hue is the foundation for infinity color masks, and since the Hue is identical in all three color samples here, they all produce exactly the same mask when sampled, and this mask is shown directly below the image.

The gray values in the mask are determined by the Saturation and Brightness of the colors that share the sampled Hue. The lightness of the grays in the mask varies depending on the Saturation and Brightness of the underlying color.

I’ve listed the pixel-based Hue, Saturation, and Brightness values for each color. Without going into the math, a color needs to have both Saturation and Brightness values greater than zero to show up as a gray tone in the mask. When two colors share the same Hue and Saturation value (second and third squares in the image), the different Brightness values determines the level of gray in the mask. When two colors share the same Hue and Brightness values (first and third squares in the image), Saturation determines the level of gray in the mask.

The lesson from this example is this: Hue is the foundation for all infinity color masks. These masks can’t exclude colors that match the chosen hue and sampling different colors that have the same Hue (but differ in Saturation and Brightness) results in identical masks. I specifically chose blue for this example since some photographers have been asking about using infinity color masks to select one shade of blue from a sky that is all blue. That’s probably not going to work too well. Remember that all three blue colors in this example have the same Hue and the Hue value is the foundation around which the infinity color mask is constructed. So you’ll get the same infinity color mask regardless of which color is sampled in this image to create the mask. In addition, because these colors share the same Hue value, you won’t be able to use the infinity color mask control window on the RapidMask module (shown below for this example) to alter the mask in a meaningful way. Neither the color range nor feathering sliders will make any difference in this example since all the colors are the same Hue. Bottom line here is that an infinity color mask is great at selecting a blue sky and displaying all the Brightness and Saturation nuances in that sky, but not good for selecting a specific shade of blue from that sky. NOTE: For slightly different hues you can try narrowing the hue range and feathering using the controls on the module (see next example), but for substantially similar Hue values, like in many skies, it might not be possible to successfully select a specific shade of blue exclusively.

This next example was sent to me by a photographer who was trying to create a mask that selected a somewhat unsaturated orange element in his image that was sandwiched between highly saturated red and yellow elements. The image below isn’t the actual image but represents the situation. Below the image is the mask that is created when sampling the middle tan color, which is actually a desaturated orange color with a Hue value of 30 degrees.

The mask generated shows a gray value for the middle square in line with the Saturation and Brightness of the sampled tan color with a Hue of 30 degrees. However, the transition zone colors for orange, red (Hue = 0 degrees) and yellow (Hue = 60 degrees), are much more saturated and brighter than the sampled color. Since red and yellow are in the initial transition zone for this tan color when it’s sampled and, because they have such higher Saturation and Brightness than the sampled color itself, they end up brighter than the sampled color in the mask.

Unlike the blues in the previous example, this is a situation that infinity color masks can handle. Because there are different Hue values for the three colors, the color range and/or the hue-based feathering can be contracted using the infinity color mask control window to exclude the adjacent hues, even though they are much more highly saturated. In this case I collapsed the color range to its smallest width and nudged the feathering slider just a bit to the left as shown in the image below.

After I did this, the infinity color mask preview looks like the image below.

The gray value of the unsaturated orange sample has not changed, but the red and yellow transition colors are now properly excluded from the mask. And even though the sampled color isn’t white in the mask, it’s still light enough to be useful for revealing an adjustment in this image. NOTE: The gray in the mask could be made even lighter using the MODIFY section of the TK7 RapidMask module.

There are two lessons from this example:

1) To make a good infinity color mask, sample a good color. And by “good color,” I mean one with a decent amount of saturation. The tan color in this example is a desaturated orange. It will never be pure white in an infinity color mask, but can still make a useful mask. As colors increase in saturation they get lighter in the mask (like the red and yellow here), and it’s generally easy to look at an image and identify which colors are saturated and which are unsaturated. A good rule to follow if you plan to use an infinity color mask is to sample colorful pixels. Black, white, and gray are “colors” with 0% Saturation. They always render as pure black in an infinity color mask, and colors approaching black, white, and gray will be very dark gray in the mask. So if you want to make good infinity color mask with plenty of light gray values indicating selected pixels, be sure to sample colorful colors.

2) The color you sample in your image will NOT necessarily be white in an infinity color mask. It might be white if it has enough underlying Saturation and Brightness, but the sampled color might also be a shade of gray in the mask, like it is here, when Saturation and Brightness are lower. And that’s OK in many cases. The mask is still properly displaying the pixel-based values for the selected color in your image, and the gray values in masks insure seamless blending when the mask controls how an adjustment gets applied to the image.

The final example image below has two unsaturated colors, dark gray and light gray, and a saturated red. The mask underneath the image shows what I got when I clicked on either of the gray squares to sample for an infinity color mask. Can you explain this?

The two gray samples, lacking any saturation, should be black in the infinity color mask, and they are. But why is the red color square white in the mask if I sampled a gray color to make the mask?

The answer lies in the Color Picker when I sampled the gray color from my image. It’s shown below with the arrow pointing to the spot on the Color Picker chosen when I sampled the light gray square.

Even though the sampled color has 0% Saturation (it’s a light gray and S = 0% in the Color Picker), Photoshop still requires every sampled color to have Hue, Saturation, and Brightness values in the Color Picker window. When the Color Picker opened, the Hue was set at its default value of 0 degrees. IMPORTANT NOTE: A Hue value of zero does NOT mean there is no hue. It means that the Hue is set to a value of “0 degrees,” which corresponds to the color red. Remember, infinity color masks always use the Hue of the sampled color as the foundation for building the mask, and, in this case, that Hue happened to be red (0 degrees). So for my image of two gray squares and a red one, the red square matches the sampled Hue, and because it is also bright and saturated, it ended up white in the infinity color mask of this image.

There are a couple of lessons here also:

1) The first is one I’ve already mentioned. Colors with zero Saturation (white, gray, or black) are always black in an infinity color mask. You cannot select colorless colors and expect them to be white or even gray with this type of color mask. Both Saturation and Brightness need to be greater than 0% to show any degree of selection in an infinity color mask.

2) The second one is that if a neutral color (white, gray, or black) is sampled to make an infinity color mask, the Hue that shows in the Color Picker will be the foundation around which the mask is built. If there are any colors in the image that are within range of that Hue, they will be selected in the resulting mask. This often comes as a surprise the first time occurs, but hopefully it now makes sense why this might happen.

Conclusion: Infinity color masks are a great way to generate masks using pixel-based Hue as the foundation. Colors with similar Hue value will all be selected by the mask. The other two components of color, Brightness and Saturation, determine the final mask. Bright and saturated colors will be lighter shades of gray or even white in the mask. Dark and unsaturated colors will be dark gray or black in the mask. Remember, infinity “color” masks are selecting COLOR. Objects without much color (unsaturated colors) will always be dark in an infinity color mask. So bright, saturated colors are what can be best selected with these masks. Or, to put it another way, a “color” mask is a poor choice for trying to select parts of an image without color. If you have a dark element or dark area in your image, or an unsaturated color, and need to select it, use a luminosity mask or a saturation mask. These types of masks are better at selecting pixels based on Brightness and Saturation.

OK, I know that’s a lot to absorb, but there’s quite a bit happening in the background when the TK7 panel makes an infinity color mask. Please feel free to leave a comment or contact me if you have any questions.