Saturation Masks 1: The problem with Photoshop’s HSB/HSL filter

In addition to my work advancing luminosity masks, I’ve also been a big proponent of saturation masks. I’ve used them since 2007 when I first started writing about saturation masks and saturation painting. The way I originally recommended making them was Adobe’s HSB/HSL filter. However, Adobe stopped including the filter in Photoshop for a number of years, so I changed to a different and ultimately better method to make saturation masks. Adobe has again included the HSB/HSL filter in the Filter menu of Photoshop CC. Now that it’s returned, this is probably a good time to review why it should NOT be used to make saturation masks.

TK Basic V6 panel

The way to run the HSB/HSL filter is to create a stamp-visible layer of the image and then convert it to HSL (Hue, Saturation, Lightness) with the filter. Once this is done, the new “Green” channel is used as a saturation mask. Sounds easy, but it’s flawed. A saturation mask created by this process poorly matches the saturation in the image, especially for dark colors.

This first blog covering saturation masks will take a closer look at the HSL/HSB filter and the asymmetry problem associated with it. It’s helpful to understand the problem before moving on to the solution. To do this, I’ll use a Granger Chart, shown below, for illustration since it makes the HSB/HSL problem quite obvious. A copy can be downloaded here. (NOTE: There are some color artifacts in the image on this blog as a result of converting from ProPhoto to sRGB for display on the web.)

TK Basic V6 panel

In the Granger Chart, the most saturated colors zigzag across the vertical center of the image. Saturation will vary somewhat depending on hue, but moving vertically, either up or down away from the center, leads to colors with decreased saturation. The saturated colors in the middle gradually transition to 100% white on the top and 100% black at the very bottom. Black and white have no color at all and so, by definition, are completely unsaturated (saturation = 0%). In other words, pixels close to the center are highly saturated, and saturation decreases in a gradual manner as you move towards the top and bottom edges.

And this is indeed what happens according to Photoshop’s Color Picker when moving vertically from the center to the top edge. The image below shows saturation values from the Color Picker at evenly spaced points along the vertical axis. As you move up from the center (Saturation = 100%), saturation values decrease progressively as distance from the center increases. Exactly as expected.

TK Basic V6 panel

But look what happens as colors get darker. Saturation values, again extracted from the Color Picker, do NOT decrease when moving downward from the center. As colors get more black and contain less color, saturation values don’t change. Saturation remains at 100% even though the amount of color present is gradually decreasing. Even the very bottom pixel of the Granger Chart still has a saturation value of 98% according to the Adobe Color Picker. Strange, huh? Why does saturation remain unchanged as color intensity decreases and black increases? And why are the dark colors different than the light colors?

The actual saturation mask produced using the HSB/HSL filter (the “Green” channel after converting to HSL) matches values from the Color Picker. It is shown below. As a quick review, a saturation mask shows white or light gray in saturated colors and shows black or dark gray in unsaturated colors. For light colors, the HSB/HSL-produced saturation mask shows a smooth decrease in saturation, fading from white to black when moving from the center towards the top edge. This is exactly as expected. The central intensely colored pixels are highly saturated and show as white in the saturation mask. When moving towards the top, saturation decreases, so the mask turns gradually darker gray until it is entirely black at the top border, which is white in the image (and therefore 0% saturated).

TK Basic V6 panel

But look what happens with this HSL mask in the dark colors. The dark colors in the image remain pure white in the mask (indicating very high saturation) even though they contain less and less color when moving from the center towards the bottom. Yes, this matches the saturation values derived from the Color Picker, but it ignores the obvious fact that color saturation actually decreases gradually as you move lower from the center of the Granger Chart. There is no corresponding smooth transition in the saturation mask of the dark colors like in the light colors as would be expected.

This is the asymmetry problem that comes from using the HSB/HSL filter to produce saturation masks. Light colors show appropriate saturation and feathering in the HSB/HSL saturation mask, but dark colors show exaggerated saturation and no feathering at all.

The important thing to take away in all this is that a saturation masks created using the HSB/HSL filter significantly (and sometimes grossly) overstate saturation in dark colors of the image. Dark colors end up being mapped as more saturated than they really are. This is also demonstrated in the image below. Its HSB/HSL saturation mask is shown beside it. Notice how the letters and numbers, even though they are nearly black, are showing as a very light gray in the saturation mask created using the HSB/HSL filter. This indicates they contain highly saturated colors. But this is obviously wrong. No way does a color this dark have the degree of color saturation indicated by the mask. Black is 100% UNsaturated, and any colors approaching black should be very dark in a mask that accurately maps color saturation. But in this mask, the characters in “OPEN” and “7 TO 7” are very light. Based on these tones in the mask, their color saturation in the image should exceed that of the deep blue sky (which is a darker gray) and approach that of the reds and yellows in “GRILL” (which are also very light gray). Even worse, the black word “GEARHART” is mapped in the mask as being more saturated than the magenta background behind the hamburger bun. These characters are clearly less saturated than this. So this isn’t just a theoretical concern that happens in a mathematical image like the Granger Chart. The same problem of the mask showing over-saturation of dark colors is also quite obvious and quite extreme in an actual image.

TK Basic V6 panel

NOTES:

  1. The question can fairly be asked as to why these dark colors aren’t actually pure white in this saturation mask of the image as the dark colors are in the Granger Chart? I’m not entirely sure, but I think this probably relates to the way the Granger Chart is created. It’s made from two gradients: one of completely saturated colors and the other of black-to-white tones. I have a feeling that the colors it produces are only a subset of all colors (even though it creates what appears to be a spectrum of all color) and it’s these specific dark colors that get mapped to 100% saturation by Adobe’s Color Picker. Although, it may also be related to how Photoshop converts from RGB to HSL. Or it could be some other reason entirely. The Granger Chart happened to be what I was using when experimenting with saturation masks, and was what tipped me off to the HSB/HSL problem of dark colors appearing more saturated than they really are. But the over-saturation of dark colors has been apparent in all “real” photos that I’ve made saturation masks for using the HSB/HSL filter. The over-saturation of dark colors is seldom 100%, like with the Granger Chart, but it is always very obvious once you’re aware of it and start comparing the saturation of dark colors with other, truly more saturated colors in the image.
  2. It is also worth noting that there is still some self-feathering of the of the over-saturation in HSB/HSL-produced saturation masks in “real” images. There is no abrupt cutoff like with the Granger Chart HSB/HSL saturation mask. So using these HSB/HSL masks would still lead to a smooth blending of whatever is adjusted through such a mask. However, visually evaluating these HSB/HSL-created masks to decide where saturation is truly present in the image is nearly impossible since the dark colors end up being so light in the mask that they frequently outshine actual saturated colors. The bottom line is that any adjustment through such a mask intended to affect actual saturated colors in the image disproportionately affect darker colors in the image instead.

SAT mask menuWith the problem described, the question becomes how to make a more accurate saturation mask, one that treats light and dark colors equally so that the saturation in darker colors gradually tapers off as saturated colors are replaced with unsaturated black. What that mask looks like for the Granger Chart is shown below and was generated using the “SAT” mask option in the TK RapidMask2 panel. It shows perfect saturation feathering in both light and dark tones. This is easily achieved when using a better method than HSB/HSL to generate TRUE saturation masks.

TK Basic V6 panel

Below is the test image along with the more accurate saturation mask generated from the RapidMask2 panel. The most colorful areas are now the brightest shades of gray in the mask and elements with little or no color (the words “OPEN”, “7 to 7”, and “GEAHART”) are very dark gray. This is exactly the way it should be in a pixel-based mask that accurately maps color saturation.

TK Basic V6 panel

I’ve been using this more advanced method for making saturation (and vibrance) masks in my panels and developing workflow for close to a decade and wouldn’t return to using the old HSB/HSL filter at this point even though Adobe once again makes it available. I’ll explain how to create these TRUE saturation masks in an upcoming blog.

SUMMARY: Saturation masks produced using Photoshop’s HSB/HSL filter display asymmetrical saturation when comparing light and dark colors. Light colors show a perfectly feathered saturation transition as colors get lighter and less saturated while dark colors get mapped as being more saturated than their color would suggest. A better method for making saturation masks would take into account pixel brightness as well as saturation.

FINAL NOTE: I’m not an expert in color models and do not know why the HSL/HSB filter maps saturation the way it does or why the Saturation values in the Color Picker remain at 100% for dark colors. I just know that pixel-based masks need to accurately display the pixel-based values I’m looking to adjust if they are to be useful. That way I can properly evaluate the mask and modify it, if need be, to match my image. In the case of saturation masks, the HSB/HSL filter is definitely substandard for creating the type of masks I want to use.

14 thoughts on “Saturation Masks 1: The problem with Photoshop’s HSB/HSL filter

  1. Thanks Tony for sharing your research. I am a big fan of both You and Sean Bagshaw because you guys always crank it up a notch for outstanding quality. Great role models!

    Like

  2. That’s very interesting,Tony. It reinforces the idea for me that it’s ‘safer’ to stick with the TK panels and leave all the research to you!

    Like

  3. Hi Tony

    Very interesting. Intuitively I would have thought that saturation (mathematically) is something like the % of white or pure gray in a color. Gray, as I understand the definition, an equal balance of Red, Green and Blue. A saturated color would have one of Red, Green or Blue as zero. Or am I totally wrong?

    Not sure what a 50% saturation would be.

    Does this make any sense?

    Rich

    RichFisher@ameritech.net +1-847-226-5311 How you relate to the issue, is the issue.

    >

    Liked by 1 person

    1. Saturation is a complex concept, Rich. It’s not just related to color. It’s also related to brightness from what I’m reading, and the different equations I’ve found for it are not a simple percentage even though the Photoshop Color Picker lists saturation as a percentage. Maybe if it were easier to calculate the HSB mask wouldn’t be so obviously wrong.

      Liked by 1 person

  4. It is unclear to me why the band of maximum saturation should be a sharply jagged line, as in the Granger diagram. Sure, it’s a mathematical construct, but I would have expected a smoother transition between hues. Talking to my wife, who is a painter, about this, she pointed me to the Munsell color sphere (which is not a full sphere, see Wikipedia) which also shows how saturation varies with hue.

    As for the Granger diagram, the only reference I found about it is on Luminous Landscape, and it gives no physical basis for the math. Pixels or not, it’d be nice to have a better foundation than that. 😉

    Like

    1. That jagged line running through the Granger chart is where the PS Color Picker shows saturation equals 100%. So the pixel values are determining that line, and at 100% saturation for those pixels, that’s a match with the Color Picker.

      As I mention in the article, the Granger Chart just happened to be what I was playing with when this saturation anomaly presented itself, and it made the issue quite obvious. Perhaps a bit too obvious given that there is some feathering of saturation in darker colors in actual images where the Granger Chart shows pure white in it’s HSB/HSL saturation mask. Regardless, HSB/HSL saturation masks are very hard to accurately evaluate for actual images since they consistently overstate dark-color saturation. The Granger Chart may be an extreme mathematical example, but it’s a clear indication of the problem that exists in actual images.

      Like

  5. Sounds like your idea of saturation should be better called vibrance, or something similar. You mentioned vibrance in the post, but I’m not sure how it’s different for what you’re trying to achieve.

    Very dark colors can have high saturation because otherwise they’d just be completely colorless and grey. For example rgb color (30,0,0) is 100% saturated red, just really dark.

    Like

    1. What I’m describing in this blog are indeed saturation masks, at least as I’d define them. Basically I want the brightness of the values in the mask to reflect the apparent saturation of the pixels in the image. So 100% saturated colors are white in the mask, 0% saturated colors are black, and colors in between are the appropriate shade of gray.

      I’m well aware of the numbers you get from the color picker that assigns both 30, 0, 0 and 255, 0, 0 a saturation value of 100, but also know that visually the 30, 0, 0 color does not appear as saturated as 255, 0, 0, since 30, 0, 0 is getting close to black. I can’t change the numbers of course, they need to be what they need to be for the color models, but I can extract saturation in a way that stratifies the saturation of dark colors so that a nearly black dark color is not 100% saturated. That’s the concept of these “true” saturation masks. They allow dark colors to have variable saturation, just like like light colors, and, certainly in my processing of images, this makes a difference when actually using these masks to adjust images.

      Like

      1. I got the idea of what you’re doing 🙂 I found your followup post where you do this using the selective color adjustment.

        Not sure if you stumbled on that method by accident or there’s some logic behind why it gives the result. I didn’t really get the reason for doing it that roundabout way, but FYI Saturation channel Multiply blend with Brightness channel would be easier.

        In fact, you can adjust both of the starting channels, and final channel, with curves, levels or blend-if. Seems much more flexible and intuitive.

        Like

      2. Nothing is easier than a single adjustment layer, IMO, especially when it’s already programmed into a button on Photoshop extension. Why bother messing around with a conversion if you don’t have to? If you want to edit the final mask, you can still easily do that also, but the adjustment layer method gives you a consistent starting point and you can work from there.

        Like

Leave a comment