Saturday, August 22, 2009

GIMP: High Pass Masking Tutorial

While checking out, I ran across Bernhard Stockmann's "Perfect High Pass Masking tutorial". On first note, this is a handy tutorial, but it's seriously outdated, no offense to Bernhard. The following steps are my approach to this tutorial, that simplifies Bernhard's. First step, let's grab the picture being used for the original tutorial (Angelina Jolie):

Step 1: Open the"Angelina" picture in GIMP, and duplicate the layer, just once. Step 2: Highlight the new duplicate layer. Run the Filters - Enhance - Adaptive Contrast script. If you don't have this script, the first thing you might want to check is your GIMP version. I am using 2.6.6. If you are running 2.6.6 and don't have the script, check with the GIMP Registry or download the GIMP Adaptive Contrast Enhancer plugin at PhotoComix's site here. The gimp-ace.exe file needs to be in either the Program Files/Gimp plugins folder or your Users/.gimp2.6/plugins folder. Read the "How To Install" file that comes with the zipped files. The settings for Adaptive Contrast is default, which should be:

Your picture of Angelina should now look like this:

Step 3: With the same layer highlighted, go to Colors - Desaturate - Average setting. Your image now looks like this:

Step 4: Select Colors - Invert. Your image should now look like this:

Step 5: Add a new layer with transparency, highlight the layer and select the Quick Mask tool or Shift + Q. The layer should now have a red film over it. Set the foreground color to white and select the Airbrush tool. Color in the body of Angelina in using white. It doesn't have to be perfect, just get it as close as you can to the edges that don't have a lot of white in the invert image. If you mess up, use black to retouch those areas. It won't actually paint the colors, it will show the red film being erased or re-added on the layer. White = full transparency (see through) and black = full opaque (not see through) in masking terms.

Step 6: Once you are done filling in the body area, like shown above, press Shift + Q again to deselect the mask and you'll now see the red film gone and a selection (marching ants) around Angelina's body.

Some people can use the Free Select tool and outline the body much faster than others can use a quick mask and get the result you see above. I have better luck with the Quick Mask simply because I can stay away from trying to "outline" the hair strands, since they show as white on the inverted image. The goal with Quick Mask is to create a quick outline to fill with white, not to achieve a perfect outline of the entire body.

Step 7: Once you have the outline, fill the interior (the body area) with white using the Bucket tool. Once that is done, we need to get the background around her body to be black. To do this, click on Select - Invert, select the Paintbrush tool, set foreground to black and color in around the body part (try to keep from coloring in the hair strands at the top, so zoom in and set your brush size accordingly. See image below:

Step 8: Merge the top layer down over the middle layer.  We will use the merged layers of black and white as a mask.

With the merged layer selected (highlighted), Select - All, this should give you marching ants around the border of the merged layer. Then select Edit - Copy. What this is doing is making a copy of the mask to the clipboard so you can paste it as a layer mask on the original image layer below it, but we have to create the layer mask on the original image layer below it, first!

Select (highlight) the original image layer at the bottom of the layers dialog, right click the mouse and Add Alpha channel. Click right again and add a layer mask. Press CTRL+V (Edit / Paste) then right click on the newly created Floating Selection layer and select Anchor layer. You should the see the result of your work now by clicking the eye on the top layer. Add any background image you want, by adding a new layer, moving the original image with the layer mask above the background layer. REMINDER: Don't forget to SAVE your original mask layer image as a *.xcf file so you can re-use it again and again.

Here's my results, with a new background included:


  1. I've needed this forever.

  2. I am getting lost on the last step (2.6.7) when I control V and select the anchor layer nothing happens?

  3. It sounds like you either didn't get a "copy" of the two previous merged layers, or you didn't add an alpha channel to the original layer. It's hard for me to say only knowing from what little you mentioned.

    When you paste the merged layers into the original layer (bottom), the original layer needs to have an alpha channel and layer mask set up before you paste the merged layer. It should produce a floating selection layer at the top. With the new floating selection selected, you click the little anchor icon in the layer dialog box at the bottom. That "anchors" your merged selection into the original layer as a mask with an alpha channel. The alpha channel is the transparent region of the original layer, so when you click the eye to off on any layers above the original layer, you should see a silhouette of Angelina with a transparent background. At this point, you can create a topmost layer of any background you wish.


If you intend to comment to complain about being unable to perform certain steps with tutorials, please explain where you are in the step process and what step you are unable to get to work correctly, instead of saying something like, "I can't do this!". Your comments will help get tutorial corrections made and help give clarification to future viewers who may have trouble in the same locations. Thank you. :)