Classic Luminosity Masking

Since writing the first luminosity mask tutorial I’ve found countless uses for them and there are always new options to explore. For new users, though, it can sometimes be a bit daunting to know where to start.  Understanding the basics of using luminosity masks can be a good stepping stone to more complex applications. A recent image provided a straightforward example of why luminosity masks can be so valuable.  I’ll use it to review some basic concepts both in words and pictures.

Here are three important things to remember about luminosity masks:

  1. They select tones in the image, not individual elements. It helps when using them to start thinking “tonally” about what will be selected with a luminosity masks instead of trying to use them to make a precise selection of a specific part of the image. Luminosity masks work best in situations where tonal differences are well-defined instead of in situations where there are obvious pixel edges.
  2. The edges of luminosity masks are perfectly feathered for blending. These masks are created from the brightness values of individual pixels. Just as a photograph is a continuous-tone image, luminosity masks provide continuous-tone blending. Sometimes this feathering can be a bit too perfect, especially in the initial masks, bleeding an adjustment into even weakly selected tones. But it’s easy to narrow the tonal range selected using techniques in the original tutorial or using calculations for 16-bit luminosity masks. Some feathering is necessary and highly desirable for insuring perfect blending of any adjustment or other Photoshop maneuver into the rest of the image.
  3. They are incredibly precise when properly used. Tonal selection and perfect feathering make it possible to use luminosity masks to make extremely targeted adjustments. Painting through an active luminosity selection is perhaps the best way to take advantage of this since multiple brushstrokes can be applied to the same area, slowly building up the desired effect, while also insuring it blends flawlessly into the image.

The image below of a cloud from a clearing storm against a mountain background is the example I’ll use to illustrate these principles. This is the nearly finished version of the image. The main problem left to fix is that the cloud isn’t as well defined as it could be. It’s an accurate depiction of what was captured, but it lacks good textural quality because the tones, especially in the brightest areas on the left, are too close together to provide meaningful definition for the viewer. The cloud still needs some work to bring out the tonal texture that is present, but hidden in the brightest tones.

two-tone

But how to isolate the cloud for additional development? It doesn’t have any good edges. The wind-blown wisps along its outer portions would be a challenge to select with any standard Photoshop tool. And the hard edges created by these tools would be equally difficult to feather into the image. However, thinking tonally, the cloud is distinctly separate from its background, so the tonal selection provided by a luminosity mask would be ideal.

While there are an infinite number of luminosity masks, it’s usually easy to spot the right one. It’s the mask that is whitest in the areas of the desired adjustment and very dark in areas where no adjustment is required.  In this case, it was the Lights-3 mask (shown below). With this mask, the cloud clearly stands out from the background.

light-3

The red-overlay “view” mode (below) shows even more clearly how perfect this mask is. Not only is it more selected in the whitest areas of the clouds (darker red), but it also feathers very nicely to the edges of the cloud (lighter red). And, to top it off, there is no red in areas immediately adjacent to the cloud. So an adjustment using this mask will affect the whitest cloud areas most and feather perfectly to the wispy edges. There will also NOT be any haloing around the cloud caused by a poorly feathered selection. The luminosity mask will confine the adjustment to only those pixels where it’s needed. NOTE: The snow-covered mountain tops and upper cloud are also showing a small degree of selection (pale red) but it is a simple matter to paint these areas black in the final mask to exclude them from the adjustment made to the cloud.

light-3-red-mask

Once the mask is decided on, it can be added to an adjustment layer. For this image a Levels adjustment works well. It takes the targeted tones and easily adds contrast to create more texture in the cloud, especially the blob-like, white areas. The Properties panel for this adjustment is shown below.

properties

The image below shows the results. Rolling the mouse over this image shows what it looked like before this adjustment. (The rollover might not be visible in the email feed, but is visible on the blog website.)  It’s easy to see how the cloud (and only the cloud) has had its texture significantly improved.  This result displays one of the ideal qualities of luminosity masks, namely that they can separate tonal differences present at the pixel level which is nearly invisible to the eye. This is exactly what I was looking to do here, and the luminosity mask made it very easy.


This is a good start. The cloud shows improved tonal separation and is more congruent with the textural qualities present in the rest of the scene. However, this adjustment also had the unintended effect of graying-down the cloud. The tonal separation has been significantly improved, but some of the brilliance has been lost.

This now is a good example of a situation where painting through a luminosity selection (Luminosity Painting) makes a huge difference. This technique lets me selectively restore the crisp whites to the cloud by painting white onto a “Dodge” layer exactly where I want to add brightness. The luminosity selection controls which pixels receive paint and how much they receive.

LUMINOSITY MASK PEARL: The “7½” and “2½” zone selections are my initial go-to masks for removing this type of midtone grayness from an image. Painting white through a Zone-7½ selection lightens the lighter grays, but, because the very lightest tones in the image are subtracted off, it prevents blowing out the whites. The Zone-2½ selection does the same for the midtone darker grays. Painting black through the Zone-2½ selection darkens these grays, but, because the darkest blacks have been subtracted off, maintains enough texture to keep the details from going black. A 30% opacity brush is a good starting point, and plan on using multiple strokes to slowly build up the desired effect.

Painting white through a Zone-7½ selection in this case nicely targets the cloud without leading to a loss of texture in the brightest whites. It also prevents spilling paint onto the darker tones in the mountains behind the clouds. Some care is taken to use a brush size that allows paint to mostly fall on the gray clouds that need to be brightened and to allow selectively painting some areas multiple times.

The “Dodge” layer for this luminosity painting is a blank pixel layer set to Overlay blend mode. This painted layer, placed against a gray background, is shown below. It demonstrates how the Zone-7½ selection very nicely confines the white paint to the cloud and how I was able to add more paint to some areas to increase the effect exactly where I wanted it.

dodge-layer

The final image is shown below. The rollover is the image before luminosity painting.


In summary, this image, with its poorly separated cloud texture, is a classic situation for using luminosity masks. Three important luminosity principles were applied:

  1.  Think tonally−Choose luminosity masks in situations where there is adequate tonal separation which can be exploited to create a useful mask or selection.
  2. Find the right mask and feathering−Look for a mask that is clearly lighter in the areas that need adjustment compared to areas that should not be adjusted.
  3. Paint for precision−Use luminosity painting to precisely burn and dodge the image to create the proper tonal balance.

These concepts can be applied to other situations where luminosity masks are being considered as a tool for image development.

If you’d like to experiment with these techniques, a downsized-size jpg of this image without the adjustments described in this tutorial can be downloaded here.

Free Panel to Make 16-bit Luminosity Masks

Lately I’ve been experimenting with several features that could make Photoshop extension panels easier to install and use. To test some of these new elements, I’ve created a mini-panel (image below) focused on just making 16-bit luminosity masks, like the downloadable actions that were available in the previous blog posts. With the new custom panel these same actions can now be run with a click of a button instead of having to play them from Photoshop’s regular Actions panel. The new panel can be downloaded free at this website.

TK-mini panel

It’s a very simple panel overall and provides the easiest way yet to quickly generate the Lights, Darks, and Midtones series of luminosity masks using the new 16-bit process. The luminosity masks generated are placed on the Channels panel, so check there for the results after clicking one of the buttons. Luminosity masks can do many things, and it’s up to the user to determine which mask they want to use and how to use it for their image. Techniques for using luminosity masks are described in the tutorials section of my website.

The CC and CS6 versions look slightly different, but do the same thing. They also have slightly different installation procedures. The complete Instructions PDF describes how to install the panel, how to use it, and also has some trouble-shooting tips. Please take a few minutes to read it before installing the panel to help insure that the process goes smoothly.

Once installation is complete on any compatible version of Photoshop, open Photoshop and click through the menu commands Window > Extensions > TK. The panel should appear. Once available, it can be opened, closed, and docked to a panels bar just like over Photoshop panels. An image needs to be open for most of the buttons to work.

This is my first experience with the new features and distribution method. If there are problems, please let me know. We can try and work them out together.

16-bit Luminosity Masks: Do they make a difference?

In the last blog post I described a new “calculations” method for making luminosity masks entirely within a 16-bit workflow for 16-bit images. The tonal ranges selected by the calculations method match those of the intersection method, but 16-bit masks and selections are smoother (less tonal variation) than their 8-bit counterparts upon close inspection. So the question can fairly be asked (and was asked in the comments on the last post) whether this new method actually makes a difference? Is there a visible advantage when using 16-bit luminosity masks instead of 8-bit masks?

The answer is: Probably not. In theoretical situations, which I’ll try to show, it’s possible to produce some differences, but producing similar differences in an actual image is harder. Even the theoretical differences are hard to illustrate in a WordPress blog like this. Jpeg images saved at the highest setting are further compressed by the website’s software effectively obscuring the subtle differences that can be seen on a monitor. To enhance the differences, I’ll also be using image rollovers. Flicking the mouse back and forth across the image edge will switch between the 8-bit and 16-bit adjustment. If you’re reading this in an email feed, the rollovers probably won’t work, so you’ll need to visit the actual blog to see them.

Before getting started it’s worth noting that conventional 8-bit luminosity masks, since their introduction in the 2006 tutorial, have become standard practice for many photographers. If there was an obvious problem with them, these masks would NOT have been become so widely accepted, integrated, duplicated, YouTube-ated (videated?), or appropriated since then. They’re now recognized as a unique Photoshop tool to blend, adjust, paint, and develop images to suit the photographer’s individual style. Other photographers wishing to demonstrate and promote their own expertise in luminosity masks have adopted the 2006-process for creating them. 16-bit masks represent an advancement, I think, in the way luminosity masks are created, but their role in actually improving images is still undecided.

I’m not aware of any problems in my images that resulted from using traditional 8-bit luminosity masks, but based on my experiments with a 16-bit tonal gradient I can create two situations where there is a theoretical advantage to using 16-bit masks.

1) Severe adjustments though the most selected pixels. To illustrate this, a 600-px by 300-px 16-bit tonal gradient was used to generate a Lights-5 (Ultra Lights) mask via both the 8-bit and 16-bit methods. The full-size gradient and equivalent Lights-5 selection is shown below. NOTE: This is a completely smooth gradient on my monitor and any visible banding is a result of jpeg compression.

Gradient with selection

The Lights-5 mask is incorporated into a Curves adjustment layer over the background gradient. The curve is then adjusted (Properties panel below) to pull the whitest value (255,255,255) down to almost black (20,20,20).

255 to 20 Curves adjustment

The gradient with this adjustment applied through the 16-bit mask is shown below. The rollover shows the same adjustment through the 8-bit mask. There’s not much difference, but if you look closely you might see some subtle banding on the far right side for the adjustment through the 8-bit mask.



By increasing the magnification to 200%, screen-capturing the result, and then saving it as a jpeg at maximum resolution, the difference now starts to show more prominently. The image below is the 2x screen capture (a right-sided quadrant of the above image) for adjustment through the 16-bit mask. The rollover is the adjustment through the 8-bit mask identically enlarged. Now there IS an obvious difference. The 8-bit adjustment is showing some definite tonal banding, but the 16-bit adjustment remains totally smooth (except for slight banding introduced by jpeg compression).


This is, of course, a totally unrealistic adjustment (255 to 20) for any image and an unrealistic viewing resolution (actual pixels x2). But it’s necessary to show what a difference between 8-bit and 16-bit luminosity masks might look like. One interesting thing worth pointing out here is that even though this extreme adjustment would never be made to an image and would never be viewed at this resolution, the 16-bit adjustment still remains tonally smooth in the adjusted area. Conclusion: 16-masks are essentially indestructible. While the adjustment through the 8-bit mask eventually cracks under the pressure of extreme adjustment and 2x magnification, the adjustment through the 16-bit mask remains completely uniform even in this impossibly theoretical scenario.

2) Significant enlargement. The requirement to use a 2x enlargement to see an obvious difference in the first example points to the second situation where 16-bit masks might show an advantage: significant enlargement. To illustrate this, a less severe adjustment (255 to 192, image below) is made to the tonal gradient, again using the Lights-5 mask.

255 to 192 Curves adjustment

After adjustment using the 16-bit luminosity mask, the gradient looks like the image below. The rollover shows the same adjustment through the 8-bit Lights-5 luminosity mask. In this case, the adjustment is not sufficient to show any obvious difference between the two methods at this actual-pixel resolution.


If this gradient image is enlarged significantly (5x for this example) and viewed at actual-pixel resolution, the tonal banding can once again can be seen. In this case I used “Bicubic Sharper” as the resample method for enlargement to sharpen and enhance any differences that might exist. A segment of the enlargement that includes the tones farthest to the right in the gradient after adjustment is shown below. This is the adjustment through the 16-bit mask. The rollover shows the same adjustment and enlargement through the 8-bit mask. The difference is slight because the adjustment is less extreme, but there is definitely some tonal banding visible in the adjustment through the 8-bit mask that isn’t visible for the adjustment through the 16-bit mask.


While this adjustment is more within the realm of possibility than the last one, it would still be very rare that the whites in the image would be pulled down this much.

An actual image. Of these two examples, the first one that involved severe adjustment is where the 16-bit mask made the most visible difference. So it’s probably worth doing something similar to an actual image to see what happens, though the results of such a similarly extreme adjustment will produce undesirable aesthetic results. In this example the white values will again be dragged down to 20 using a Curves adjustment layer though a 16-bit and 8-bit luminosity mask. The Lights-4 mask will be used in this case in order to include enough pixels to actually see a significant change in the image.

255 to 20 Curves adjustment

Below is the a jpeg of the image that was used for this demonstration. The rollover shows the image after the adjustment. The full-size image measures 5616-px by 3744-px. The green box shows the area of the original image that is enlarged below.


This is obviously another unrealistic adjustment, but, as seen above, it takes something this extreme to produce a visible difference between 8-bit and 16-bit luminosity masks.

Below is a screen shot of the green-box area adjustment through the 16-bit Lights-4 mask viewed at 200% magnification, which is twice as magnified as actual pixels (actual pixels x2). The rollover is the same area with the same adjustment except done through an 8-bit Lights-4 mask.


In this situation there is barely any difference, and certainly none of the obvious tonal banding that was seen with the severe adjustment to the smooth gradient in the first example. You might be able to see a little better definition in the noise in the grayed-down sky of the “8-bit” image, but given the magnitude of the overall adjustment, this difference is tiny.

But why is this? Where is the expected tonal banding in the 8-bit adjustment? I can’t say for sure, but I have a theory. A perfectly smooth tonal gradient, like that used in the examples above, doesn’t really exist in a digital photograph. It’s only something that can be created in Photoshop. In a digital photograph the natural noise and the color variation captured by the camera’s sensor takes the place of the smooth gradation of the Photoshop gradient. These pixel-level, sensor-captured tonal dissimilarities, which are smooth and essentially invisible when looking at the image at any normal viewing resolution, are exaggerated upon severe adjustment though a luminosity mask. So instead of tonal banding with severe adjustment, this natural “grain” just gets “grainier.” It accommodates the tonal changes that accompany a severe adjustment through a luminosity mask (takes the place of banding), and appears to be about the same regardless of whether the luminosity mask is created via the 8-bit or 16-bit method. In other words, instead of tonal banding, an actual image shows tonal “graining” with severe adjustment, which looks similar to noise. The increase in tonal noise/grain is probably a bit more pronounced with 8-bit masks than with 16-bit masks, but because it’s at the pixel level (like luminosity masks) and not in prominent bands, it’s hard to actually see any difference.

The image below attempts to show this increase in grain/noise. It’s a screen capture at 300% zoom (actual pixels x3) of a not-too-grainy-but-not-quite-pure-white area of the sky in another part of the image that is affected by the adjustment. (It’s just to the left of the green-boxed area in the jpeg of the entire image.) The rollover shows how much grainier/noisier this area becomes after the severe adjustment through the 16-bit mask. Severe adjustment of the pixel-level tonal variations that come with digital capture and which are sorted out and enhanced by luminosity masks account for this enhanced grain/noise at this magnification. It happens even with the severe adjustment through the 16-bit mask, which is shown here, but is not nearly as obvious as the tonal banding seen in the gradient examples above. It’s also worth remembering that 16-bit masks are so perfectly matched to the tones in the image that even severe adjustments blend in smoothly. So this graining effect, which is visible at this magnification and occurs with both 8-bit and 16-bit masks, would not be visible in the image itself, especially if the tonal adjustment was more reasonable.


Conclusion. The examples in this blog looked at how a smooth 16-bit Photoshop-generated gradient reacts differently when adjusted through 8-bit and 16-bit luminosity masks. In theoretical situations at magnified viewing resolutions some noticeable differences can be seen. However, similar changes would be significantly less visible in actual digital photographs even at exaggerated viewing resolutions or enlargement because very small tonal differences captured by the camera’s sensor provide enough tonal variation to obscure the expected banding that was seen in the theoretical examples. Some combination of multiple or severe adjustments through 8-bit luminosity masks on smooth tonal areas of an image combined with significant enlargement might produce a noticeable effect in certain circumstance. But it will likely take nose-to-the-image viewing or monitor magnification to actually see it. For most images with routine processing and enlargement it simply won’t exist, especially in areas with lots of detail or structure. I have repeated the experiment using severe adjustments using both Midtone and Darks luminosity masks and have also done the same adjustments on different images. The 8-bit grain/noise with extreme adjustment is more apparent in some images, but it takes at least 300% magnification (400% is better) to appreciate any difference between 8-bit and 16-bit luminosity masks.

Other Considerations. There are some additional variables that could come into play when working on actual images. For example, it’s important not to overlook the fact that the smooth blending inherent with luminosity masks allows adjustments to be pushed further than would normally look natural, so a critical “severe adjustment” threshold might actually be reached or exceeded in certain circumstances. Also, the quality of the sensor data could play a role. Better (smoother) data might increase the likelihood of seeing banding instead of graining. (NOTE: Lens quality might also influence the sensor data and my consumer-grade zoom lens might have different results than a professional prime lens.) And perhaps other luminosity mask techniques have different outcomes. Only adjustment through a mask on an adjustment layer was investigated here. Maybe exposure blending, mask painting, or luminosity painting will show a more pronounced effect. Still, any improvement with using 16-bit luminosity masks is likely to be subtle at best. In almost all situations, images developed using 8-bit luminosity masks will likely look just as good (or identical) as those made with 16-bit masks.

The future of 16-bit luminosity masks. I admit to being somewhat disappointed that the advantages of 16-bit luminosity masks seen in the gradient experiments ended up being less evident in actual images. While my use doesn’t indicate a breakthrough improvement from using 16-bit luminosity masks, perhaps the experience of other photographers will be different. I still intend to incorporate the new process into my custom panel in the near future. Creating 16-bit luminosity masks using Photoshop actions takes no more computer processing time than using the traditional method so there’s no reason not to use the best method available, even if the advantages are just theoretical for the most part at this time. If you’d like to practice with 16-bit masks now, a free download of an action set to create them is available here. If you do come up with an example where 16-bit masks are clearly superior when making “reasonable” adjustments, please let me know. I’d like to post or link to the results in order to have a good reason to recommend 16-bit masks as the new standard.

How to Make 16-bit Luminosity Masks

In 2006 I released the Luminosity Masks tutorial. It described a process for creating selections and masks in Photoshop based on the brightness values of the image. Instead of a spatial selection where the marching ants enclose a specific area or element in an image, luminosity selections are tone-based. They look at the brightness each pixel and then group together similar tones across the image.

Because they are created directly from brightness values of individual pixels, luminosity masks and selections are completely self-feathering. Selections automatically adjust to match pixel brightness as brightness varies across the image. The continuous-tone property of photographs becomes the perfect-blending property of luminosity masks.

The method described in that original tutorial successively intersected luminosity selections to make the Lights-series and Darks-series of masks anchored in either the lightest or darkest tones in the image. Midtone selections were created by first selecting the entire image and then subtracting off a Lights-series mask and a Darks-series mask. This method for creating luminosity has been widely adopted and reproduced by other photographers wanting to use and promote these techniques.

Last year I started to receive email questions about whether luminosity selections change the bit depth of selected pixels from 16-bit to 8-bit. The answer to this is “No.” It would take something like the Image > Mode command to do that. A little research, though, showed where this misconception was coming from. It turns out that regardless of the bit depth of the image, selections are always 8-bit. Even on a 16-bit image, selections are still 8-bit. The bit-depth of the selection, though, is only referring to the degree of selection possible within the selection (up to 256 for 8-bit). The bit-depth of the image, on the other hand, is describing the amount of color information each pixel can display (65,536 levels for each color channel in RGB). They’re not the same thing. The 8-bit degree of selection is only determining how adjustments get passed to the pixels below. It is not changing the 16-bit precision of the color data in those pixels.

Unlike selections, the bit depth of masks always matches the bit depth of the image. Layer masks and channel masks on a 16-bit image are themselves 16-bit. This information got me thinking about alternate ways to make luminosity masks. While luminosity selections would always be 8-bit, could pure 16-bit luminosity masks be made for a 16-bit image? In other words, instead of intersecting and subtracting 8-bit luminosity selections to make luminosity masks, could these masks be made without the intervening 8-bit steps?

The answer is “Yes!” Photoshop’s Calculations dialog (Image > Calculations…) provides the key. This dialog can be a bit confusing and is not often used by most photographers. But it’s quite powerful. It can take the 16-bit data from an image or individual channel and, after doing the calculations, output it as a 16-bit channel mask. So it’s 16-bit in and 16-bit out with no 8-bit in between.

If you’re familiar with the series of masks described in the Luminosity Masks tutorial, a few screen shots should be enough to illustrate how the traditional process described there can be converted to Calculations.

The starting point is the same − make the “Lights” mask (which I’m now calling “Lights-1” to make this process easier to follow). Below is a screen shot of the Calculations parameters used to create the “Lights-1” mask.

Calculations for Lights-1 mask

The output of this Calculations dialog is a new channel on the Channels panel. Looking at the channel by clicking on it will show that it is a grayscale version of the original image. This new channel IS the 16-bit “Lights-1” luminosity mask, so it’s helpful to double-click the name of the channel and give it the proper descriptive name (“Lights-1”) which will be used in the next calculation.

The next mask in the progressive Lights-series was originally made by intersecting the first “Lights-1” selection with itself. In the 16-bit workflow, “Multiply” blending mode in the Calculations dialog accomplishes the same thing as “intersection.” So the parameters for making the “Lights-2” mask would be as shown below.

Calculations for Lights-2 mask

The resulting 16-bit mask is again output to the Channels panel where it can be given the name “Lights-2.”

Successive masks in the Lights-series are created in the same manner by using the previous mask as the “Channel:” in the Calculations dialog and setting the “Blending:” to “Multiply.” After repeating this procedure a few times the Lights-series of 16-bit luminosity masks is available on the Channels panel.

The Darks-series just requires one change at the start. The “Invert” checkboxes need to be checked to make the initial “Darks-1” mask the negative of the original image. The Calculations dialog is shown below.

Calculations for Darks-1 mask

Once the “Darks-1” mask has been created, the remainder of the Darks-series is made the same way as the Lights-series − the previous mask becomes the “Channel:” and “Blending:” is set to “Multiply.” (NOTE: The “Invert” boxes are only checked when making the “Darks-1” mask. They remain unchecked for rest of the Darks-series.)

Finally the midtones. The traditional way to make them was to select the entire image and then subtract off one Lights-series mask and one Darks-series mask. The equivalent set-up for Calculations is shown below. One “Channel:” is a Light-series mask and the other is a Darks-series mask. Both are inverted and the “Blending:” is set to “Multiply.”

Calculations for Midtones-1 mask

When any of these 16-bit luminosity masks are loaded as a selection, the selection is still 8-bit. That’s hardwired into Photoshop and cannot be changed. So exact pixel-for-pixel bit-depth-matching between the mask’s 16-bit data and the selection’s 8-bit degrees of selection is not possible. The selection will always be less precise than the image or mask when working in 16-bit mode. But the starting point for these 8-bit selections is now always a “first-generation” 16-bit mask. So while there will be slight variations between the pixels in the mask and the degree of selection in the selection, there is no cumulative variation from successively intersecting masks. I hope to take a closer look at what this means in a future post.

For those who want a purely 16-bit workflow, it is possible to skip selections entirely. Photoshop’s Apply Image command (Image > Apply Image…) can be used to move a 16-bit channel mask to the Layers panel to serve as layer mask for an adjustment layer. Apply Image is also 16-bit in/16-bit out.

While slightly less intuitive than the traditional method for making luminosity masks, the number of steps in the Calculations method is about the same. That means that it’s still cumbersome to work through the process of creating all these masks. To help speed it up, the free panel on the Panels & Videos page will quickly make all the 16-bit Lights, Darks, and Midtones luminosity masks for you. A PDF on how to install the panel plus a video how to use it is included for those not familiar with the process. Additional tutorials on luminosity masks are available on my website.