gimpusers.com logo
German version English version

Not logged in

Sign up! | Lost password?

Latest discussion

  1. gimp-docs | yesterday 10:32 PM
    "make validate" and <revnumber>
  2. gimp-docs | yesterday 09:56 PM
    Cygwin and .po, first steps
  3. gimp-user | yesterday 07:59 PM
    Fonts
  4. gimp-developer | yesterday 07:00 PM
    Adjustment layers
  5. gimp-docs | yesterday 06:57 PM
    Omitted languages

External news

Poll

Do you enjoy GIMP 2.6?

Great work! I love it (please post why)

It's okay - could have been more changes

I was not able to install it yet / it does not work currently

I don't like it (please post why)

See results

Stats

gimpusers.com RSS feed

23 Nov 2008 06:24 PM

Masking hair with fine strands

There are many ways of masking objects with GIMP. This tutorials shows a way that produces good results for fine details like strands of hair, especially for portrait photos with a simple background.

This article has been written by devvv (Bernhard Stockmann) using GIMP 2.6 and translated to English by redforce (Richard H.). It's divided into 14 steps and takes about 30 min to complete for an average user. 5794 times read so far. Category: Techniques, required skill: 4 of 5

10 comments have been posted so far.

Available in other languages:

Files you need if you try this tutorial:

  1. 1
    This masking technique is good for strands of hair or to replace the sky.

    On the image, you can see the fine hair strands and the mat gray background.
    Screenshot of step 1
    Click to enlarge
  2. 2
    Now we want to create a detailled layer mask that contains all fine details of the hair.

    To do so, we have to create a copy of the background layer first:

    Click on the "Duplicate layer" button in the layer dialog or press Ctrl+Shift+D.
    Screenshot of step 2
    Click to enlarge
  3. 3
    The next step is important: We reduce the layer's color by disaturation. The best way to do so is using the channel mixer:

    - Colors / Components / Channel Mixer
  4. 4
    Now click on "Monochrome" so the image will become grayscaled.
    Screenshot of step 4
    Click to enlarge
  5. 5
    You can see in the preview that the image doesn't have colors anymore.

    Now it is important that we achieve a good contrast between the background and Jessica's hair.

    For this you have to find out the individual settings for each image. There are no working generic settings. Pay special attention on the fine hair parts. Try to make them light gray while the background (here: gray) should become darker or stay at least the same. It doesn't have to be perfect because in the next step, we'll do some fine-tuning.

    The fine hair details should NOT blur with the background. It doesn't matter if the image becomes granular or if the face looks strange (like on the screenshot). Only the HAIR matters.

    I have also amplified the red color tones (the hair contains many of them and become brighter) and reduced the blue tones so that in sum the background doesn't become brighter. I slightly amplified the green part. The green channel often contains details and contrasts, so the hair is masked even better.
    Screenshot of step 5
    Click to enlarge
  6. 6
    Now my image looks like this:
    Screenshot of step 6
    Click to enlarge
  7. 7
    Now we paint the parts that don't need masking with white (the skin and the hair where's no background).

    - Select the Paintbrush tool
    - Use a big brush size (relatively hard with some soft edge)
    - Choose foreground color: white
    - Make the parts white

    Hint: Choose a very hard brush for the region at the left bottom (shoulder skin). It's often useful to combine different brushes.

    Then start painting the regions that don't contain details revelant for masking. You can paint them roughly/quickly.

    Now my image looks like this:
    Screenshot of step 7
    Click to enlarge
  8. 8
    Now we adjust the gray tones of the picture. For this it is important to make the background completely black while the hair should become (nearly) white. In the next step everything that is white will become visible and black regions will become transparent.

    Choose: - Colors / Levels

    In the dialog, you can find three moveable control triangles. The gradient from black to white represents the amount of different gray tones in the image. If you move the left control triangle towards the center, the amount of black will be reduced and become a dark grey. The right control works vice versa. The middle control is for fine-tuning. You can use it to make the remaining grey tones a bit brighter or darker.

    As you can see in the preview, the bright hair strands have become even brighter while the background has become darker.
    Screenshot of step 8
    Click to enlarge
  9. 9
    We have a perfectly adjusted grayscale layer now that determines which regions become visible or transparent.

    Now we have to create a layer mask and copy the details from the grayscale layer to this mask.
    Screenshot of step 9
    Click to enlarge
  10. 10
    - Select / All (oder hit Ctrl+A)
    - Edit / Copy (or hit Strg+C)
    - activate background layer
    - Right-click into the layers dialog: "Add layer mask" (White)
    Screenshot of step 10
    Click to enlarge
  11. 11
    - Click on the small white area next to the background layer in the layer dialog to ensure that you're working on the mask and not on the picture itself.

    - Edit / Paste (or Ctrl+V)

    Important: After that, the pasted layer is a floating selection. To fixate it on the layer, use the "Anchor" button of the layer dialog (at the bottom, 2nd from right). Your layers dialog should now look like this:
    Screenshot of step 11
    Click to enlarge
  12. 12
    Click on the eye symbol next to the grayscale layer above. Then the layer will disappear and the hair details should be visible on a transparent background.
    Screenshot of step 12
    Click to enlarge
  13. 13
    At the end, we want to insert a new background and do some final adjustments.

    Save the "wood" background (you can find the download link at the beginning of the tutorial), choose File / Open as Layers and select the wood.

    It should be an own layer in the image now. In the layers dialog, move the wood layer to the bottom.
    Screenshot of step 13
    Click to enlarge
  14. 14
    Now it's nearly perfect, but we can do even better (because when you zoom in, you can see some remaining gray of the original image background).

    We can improve this with some color adjustments again:

    - Select the layer mask
    - Colors / Levels

    The aim is to get the hair strands even darker (i.e. more transparent). So I move the left control to the center. You can see the results in the preview immediately.

    I hope you could learn something and it was fun for you.

    Ideas for more improvements:

    - On the layer mask, you could work with light/dark gray brushes to do some detailled corrections, for instance to remove regions that are not so beautiful.

    - Use the Smear tool to "melt" the foreground with the background in order to remove too hard transitions.
    Jessica Alba masked with new background
    Click to enlarge

This article is licensed under the following license: Creative Commons Attribution-NonCommercial 2.0 Austria

Comments

Post your own comments, questions or hints here. The author and other users will see your posting and can reply to it. Of course, you can also ask in the chat.

Comments are chronologically arranged.

  1. Robert, 24 Nov 2008 04:39 PM

    Wow very impressive devv!! Thanks

  2. ardie, 25 Nov 2008 10:32 AM

    wow!

  3. Roger, 25 Nov 2008 10:57 PM

    Once you have your mask created and your background layer pasted beneath, right click the foreground image layer and click "Edit Layer Mask" and you can paint the mask with white and black to fine tune it. This is very nice to get the finishing touches because you can see the background and the foreground together.

  4. Matt, 26 Nov 2008 06:42 PM

    I'm lost after part 6. Part 7 just says "make it white". Well that's fine, but do I have to go through the image and tediously paint everything white while "staying inside the lines"?

  5. devvv, 27 Nov 2008 01:09 AM

    Matt: yes, first take a big brush, paint skin and body very fast with a big brush-size. then take a smaller one to paint the parts that are nearer to the fine detail. only paint over the parts that should be totally visible in the end!

  6. Travelster, 29 Nov 2008 09:29 AM

    Leaves out explanation of too many steps for Gimp beginners.

  7. Tyler, 07 Dec 2008 02:45 AM

    Yeah not enough explanation behind things, far too many steps left out that took a while to figure out, then in a part you explained it wasn't nearly well done enough so I just gave up because I had no clue what I was doing. The rest were simple things that just took a long time to find, but the part with the greyscale just doesn't work out without you explaining it at all.. In tutorials you shouldn't just say "Okay make this white, okay add a transparent mask to this" etc etc. It should be "Make this white by doing this, now add a transparent mask to it. (You add transparent masks by doing this this and this).. Simply not enough information.

  8. ellen, 20 Dec 2008 11:54 AM

    Hi, I am a gimp beginner and I found this excellent. You explained everything in a very straight forward way. The other people who left comments need to spend a little time learning about easier things like masks before they attempt the harder stuff like this. They seem to want the whole of gimp explained to you by them which is impossible to do. The best way to learn it to spend time with Gimp. Thank you so much for this information. I'm going to really enjoy messing around with this feature.

  9. Pete, 24 Dec 2008 05:31 AM

    Brilliant tutorial. Its comments like some above that stop people doing such great pieces of work. Ignore the idiots, because the rest of us appreciate it.

  10. Saere, 26 Dec 2008 09:30 PM

    I found this tutorial when I first started using Gimp, and I'll admit I was rather lost. Now, a few weeks later, I've reread it and recognize how helpful it is. Thank you! I need to keep practicing of course, but now understand the basics. :)

Registered users can log in (top right of the page) to use their profile name to post comments, request email notification on new comments and attach images (e.g. their versions of the effect) to their postings.

Are you human?

Adobe® Photoshop® is a registered trademark of Adobe Systems, Inc. Linux is a trademark of Linus Torvalds. Ubuntu and Canonical are registered trademarks of Canonical Ltd. | Clock times are shown as CET / CEST | Imprint | powered by bitfire it services