GIMP luminosity masks: 1 simple plug-in makes it easy

I looked for a plug-in or script that would make GIMP luminosity masks easy …

… and it was an adventure. I’m going to make it easy for you. Here’s how.

GIMP luminosity mask example featured image, colour photograph of a building with gold windows on the left, grey clouds in the middle, and a palm tree silhouetted on the right bottom

Why did I search for a GIMP luminosity mask solution?

Luminosity masks in photo editing are a powerful tool that allow you to select specific tonal ranges in an image without affecting the rest of the image. They select luminosity values to create complex selections that aren’t possible with simple selection tools. Madhu Manickam at photographylife.com has written a short tutorial explaining luminosity masks.

I’ve used Greg Benz’s Lumenzia luminosity mask plugin in Photoshop for years. He explains luminosity masks from the perspective of why he developed Lumenzia.

However, Greg’s Photoshop plug-ins (including his Web Sharp Pro) only work with … Photoshop. I love Photoshop and Camera Raw for lots of reasons. But I’m trying to go without a Photoshop subscription to see how I get on, and GIMP is the obvious alternative. There are lots of other free image editing options out there, but none of them has GIMP’s scope, even with all its (many) imperfections.

So I set out to find a solution for luminosity masks in GIMP.

I found several, both scripts and plug-ins, but none of them worked! Not in Linux or Windows, not in GIMP 2 or GIMP 3 (beta). I followed all the instructions to the letter but they never appeared in the GIMP menu as they were supposed to. Then I discovered that the standard GIMP plug-in installation instructions were incorrect.

The most recent plug-in that I found was almost exactly what I was looking for. Since it’s open source, I modified it to work more along the lines of Greg Benz’s Lumenzia, and other standard Photoshop luminosity mask tutorials.

So to make everyone’s life just a little easier, I share (below) a link to the up-to-date plug-in and corrected instructions that work (very easy).

But first, let’s review what I found.

What options are out there for GIMP luminosity masks?

Back in 2013, Pat David shared a couple of tutorials covering how to use luminosity masks in GIMP, here and a followup here. He demonstrates how luminosity masks in GIMP can take landscape photographs to another level. He also includes a link to a GIMP luminosity masking script he wrote, along with a link to an updated version by Saul Goode.

Then I found a more recent (2019) plug-in written by “ofnuts”. I don’t their real name, just what they share on the Internet. They have a treasure trove of scripts and plug-ins available for use and learning at Ofnuts’ Gimp Tools Files on SourceForge.

I’ve updated Ofnuts’ plug-in to make luminosity masks more obvious and user-friendly, along the lines of what I’m used to in Lumenzia.

As a side note, I also found a great tutorial about darktable luminosity masks. It’s long but worth the read. I think it’s a more elegant solution, but if for whatever reason you’re not using darktable, then this plug-in solution in GIMP will work too. I use both. And I plan to explore how to employ the darktable approach in GIMP.

what’s the solution that works for GIMP luminosity masks nowadays?

This most recent (November 2023) version of the plug-in lets you select from 9 base luminosity masks: 3 light, 3 midtones, and 3 darks. It then adds a greyscale luminosity mask to whatever layer is currently active in your GIMP image. You can use that mask as-is, or fine tune it using levels and curves (a trick I learned using Greg Benz’s Lumenzia.

How to install the plug-in

(If you run into any problems with any of the steps below, please let me know in the comments below.)

1. Download the plug-in

Download the GIMP luminosity mask plug-in as a ZIP file. You’ll extract it as described below in the next section:

luminosity-masks.zip

2. Copy the downloaded file to where GIMP looks for plug-ins

This is something you have to do for every plug-in you add to GIMP. I discovered that the only reliable way is as follows.

Find where GIMP looks for plug-ins:

  1. Open GIMP if it’s not already open and select Edit > Preferences in the GIMP menu.
  2. In the Preferences dialog, scroll down the list on the left until you find Folders, then click on the expand icon in front of the word to expand that list.
  3. Scroll down the list of folders and select Plug-ins.
  4. Still in the Preferences dialog, on the Plug-in Folders panel on the right, select the plug-in folder that’s listed for your user name.
  5. Click on the “Show file location in the file manager” to open your computer’s file manager.
  6. Copy the .ZIP file you downloaded into that folder and extract it there. You should see a subfolder named “luminosity-masks”. The plug-in is inside that folder (see the note below for why it should be in its own subfolder). Don’t move it, just leave it in that luminosity-masks subfolder.
  7. Switch back to the GIMP Preferences dialog, and select the “Add a new folder” icon, then click on the icon for “Open a file selector to browse your folders” to … open a file selector to browse your folders.
  8. In the file selector, navigate to the luminosity-masks subfolder you added already, select it, and click OK.
Screenshot of GIMP plug-ins folder setup showing an example location for the GIMP dodge and burn plug-in
Example of the GIMP plug-ins folder showing a example location for GIMP plug-ins including the luminosity-masks plug-in

Click OK in the Preferences dialog to close it.

3. Register the plug-in with GIMP

Now you have to register the plug-in with GIMP: just close and re-open GIMP.

If all has gone according to plan, you should find a menu entry called Layer > Luminosity. If not, please leave a comment below.

Here’s where the Linux instructions I found online conflicted with my reality. Everywhere I looked online, the instructions for adding scripts to GIMP in Linux said to open the Preferences dialog and look for the relevant folder(s) where GIMP was supposed to be configured to look for plug-ins, and install a new plug-in in that folder. But either those folders didn’t exist, or GIMP ignored them.

Furthermore in some versions of GIMP (eg Windows, 2.99+) you have to add the subfolder where you’ve saved the plugin file to the list of folders where GIMP looks for plugins, and that folder needs to be named exactly the same as the plug-in with that subfolder.

This appears to be a relatively recent change to how GIMP works, and I haven’t seen it documented anywhere. This is an example of how working with free software isn’t entirely free—you have to do some of the work that other systems automate, and put your thinking cap on.

Since that’s the future of GIMP, we’ll just take it as a requirement from now going forward.

how do you create luminosity masks with this plug-in?

First, open the image you want to work with if it’s not already open.

Next, create or select the layer you want to add a luminosity mask to.

Now choose Layer > Luminosity from the GIMP menu.

You’ll see a submenu: Darks, Lights, and Midtones. The three L channels cover several intensities of light values, the M channels cover midtones, and the D channels cover darks.

Each of those submenus open to give you three choices, DDD, DD, D, LLL, LL, L, and MMM, MM, M. A triplet of letters is the strongest option, and a single letter is the least. Choose whichever one you want. It’ll create a channel for that selection, then convert it to a greyscale mask that becomes visible.

Use Levels, Curves, or any other tool if you wish to fine tune the greyscale mask. (A trick I learned from using Lumenzia.)

Lastly, un-show the layer mask by right clicking on the mask thumbnail, unselect “Show Layer Mask”. Or use the built-in keyboard shortcut: CTRL+ALT and left click on the layer mask thumbnail (CMD+OPTION is the shortcut on a Mac).

Remember to click on the image thumbnail on that layer to make any adjustments you want to make to your masked layer.

Here’s an example

This image shows the original colour photo, and the black and white luminosity mask I created. I used the DDD mask, levels, curves, and a black brush to refine the mask to hide everything except window ledges and the silhouetted palm tree.

GIMP luminosity mask example without luminosity mask, colour photograph of a building with gold windows on the left, grey clouds in the middle, and a palm tree silhouetted on the right bottom GIMP luminosity mask example with luminosity mask, black and white, with only horizontal dark window ledges and a palm tree highlighted

Here’s another example

This is a more complicated use case. I wanted to accentuate the snow covered branches. Selecting them would have been impossible using normal selection tools. A luminosity mask selecting for lights made it simple to focus just on the branches, then use a curve to lighten them.

A luminosity mask also has the advantage of showing/hiding across a spectrum of luminosity values. In this case, the background trees are more faintly highlighted than the foreground tree. The luminosity mask shows them more dimly.

Just using an S or more complicated curve on this image would have required a lot more work, and delivered less accuracy. A luminosity mask is perfect for the job in this case.

Blue toned image of a tree next to a hunters’ blind in a field, with show covered forest on a hill behind them.
Example: image before luminosity masking
Black and white high contrast image of a tree next to a hunters’ blind in a field, with show covered forest on a hill behind them.
Example: luminosity mask
Blue toned image of a tree next to a hunters’ blind in a field, with show covered forest on a hill behind them.
Example: image after luminosity masking and curves adjustment

Here’s the before and after for easier comparison:

How to manage any layer mask in GIMP (including your luminosity masks)

You can manage a GIMP luminosity mask the same way you handle any other layer mask in GIMP. And you can make it even easier if you can create keyboard shortcuts for any of the following actions: Edit > Keyboard Shortcuts.

How to show a layer mask in GIMP

Show a layer mask to reveal the mask instead of the layer contents; this allows you to visualise the mask and edit it if you want.

Right click on the layer mask thumbnail and choose “Show Layer Mask”.

How to hide a layer mask in GIMP

Hide a layer mask to reveal the layer contents; the layer mask remains in place and functional, without displaying it.

Right click on the layer mask thumbnail and unselect “Show Layer Mask”.

How to disable a layer mask in GIMP

Disable a layer mask to temporarily stop it from affecting the layer, without deleting the mask entirely.

Right click on the layer mask thumbnail on the layer, choose “Disable Layer Mask” or use the keyboard shortcut CTRL/CMD and left click on the mask thumbnail.

How to delete a layer mask in GIMP

Delete a layer mask to remove it from the image.

Right click on the layer mask thumbnail on the layer, choose “Disable Layer Mask” or use the keyboard shortcut CTRL/CMD and left click on the mask thumbnail.

Now you can use luminosity masks in GIMP

Please let me know if you have any questions or thoughts you want to share in the comments below.

FAQ

Does GIMP support luminosity masks?

Yes, you can create luminosity masks by first generating a luminosity channel, then create a mask based on that channel. It’s easy with a plug-in, challenging without.

How can I create a luminosity mask in GIMP?

Use the luminosity masks plug-in:

1. Select the layer you want to mask.

2. Choose Layer > Luminosity in the GIMP menu (installed by the plug-in).

3. Select the type of luminosity mask you want from the 9 options available in the menu—3 each for light, dark, or midtone.

4. If you want, you can fine tune the mask using levels, curves, or a brush.

5. Un-show the mask and edit your layer. You can always show the mask again and fine tune it, or create a different mask.


Comments

3 responses to “GIMP luminosity masks: 1 simple plug-in makes it easy”

  1. The plugin doesn’t work in GIMP3. Is there an updated version which will work?

    1. Hi Patrick

      Thanks for getting in touch. I’m finalising a version for GIMP 3. I hope to have it ready next week. I’ll let you know when it’s ready

      Chuck

Leave a Reply

Your email address will not be published. Required fields are marked *