gimpusers.com logo
German version English version

Not logged in

Sign up! | Lost password?

Latest discussion

  1. gimp-user | today 09:49 AM
    Need help: "correcting" exposures in time-lapse imagesets
  2. gimp-developer | today 06:14 AM
    GIMP color-management spec and further discussion
  3. gimp-user | yesterday 11:13 PM
    collages in gimp?
  4. gimp-developer | yesterday 07:07 PM
    Color management (UI perspective for GIMP 2.8)
  5. gimp-user | yesterday 02:42 PM
    printing

External news

Poll

Would you like to be able to use your Google/Yahoo/MSN (OpenID) login on gimpusers, too?

Definately! I would enjoy the possibility to use my OpenID on different websites!

I don't have a special need for OpenID but I think it could be useful

Doesn't matter to me

Never, OpenID is a pain regarding privacy and personal data protection!

No. (please post a comment)

See results

Stats

gimpusers.com RSS feed

RSS feed Retweet this!

23 Nov 2008 06:24 PM, by devvv (Bernhard Stockmann), translated to English by redforce (Richard H.)

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 using GIMP 2.6. It's divided into 14 steps and takes about 30 min to complete for an average user. 58077 times read so far. Category: Techniques, required skill: 4 of 5

21 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: Attribution-Noncommercial 3.0 Austria

Links (pingbacks)

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 rating(s) with 5.0 of 5 stars in average

  1. http://www.gimpusers.com/tutorials/mask-hair-strands.html Mon 24 Nov 2008 04:39:31 PM CET Robert, 24 Nov 2008 04:39 PM

    Wow very impressive devv!! Thanks

  2. http://www.gimpusers.com/tutorials/mask-hair-strands.html Tue 25 Nov 2008 10:32:53 AM CET ardie, 25 Nov 2008 10:32 AM

    wow!

  3. http://www.gimpusers.com/tutorials/mask-hair-strands.html Tue 25 Nov 2008 10:57:00 PM CET 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. http://www.gimpusers.com/tutorials/mask-hair-strands.html Wed 26 Nov 2008 06:42:26 PM CET 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. http://www.gimpusers.com/tutorials/mask-hair-strands.html Thu 27 Nov 2008 01:09:35 AM CET 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. http://www.gimpusers.com/tutorials/mask-hair-strands.html Sat 29 Nov 2008 09:29:20 AM CET Travelster, 29 Nov 2008 09:29 AM

    Leaves out explanation of too many steps for Gimp beginners.

  7. http://www.gimpusers.com/tutorials/mask-hair-strands.html Sun 07 Dec 2008 02:45:46 AM CET 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. http://www.gimpusers.com/tutorials/mask-hair-strands.html Sat 20 Dec 2008 11:54:12 AM CET 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. http://www.gimpusers.com/tutorials/mask-hair-strands.html Wed 24 Dec 2008 05:31:41 AM CET 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. http://www.gimpusers.com/tutorials/mask-hair-strands.html Fri 26 Dec 2008 09:30:53 PM CET 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. :)

  11. http://www.gimpusers.com/tutorials/mask-hair-strands.html Wed 07 Jan 2009 09:16:19 PM CET janrode, 07 Jan 2009 09:16 PM

    Very well structured tutorial, as beginner I came to a good result in less than 30 minutes.

  12. http://www.gimpusers.com/tutorials/mask-hair-strands.html Mon 26 Jan 2009 03:58:36 PM CET Adianna, 26 Jan 2009 03:58 PM

    wow.. I've been looking for something like this for soooo long... problem is... the hair I have is platinum with black tips... I have it on a white BG .... how do I set the levels? I couldn't get anything but complete white or Black.

  13. http://www.gimpusers.com/tutorials/mask-hair-strands.html Tue 03 Feb 2009 08:03:56 AM CET mamboze, 03 Feb 2009 08:03 AM

    Thank you very much for a brilliant tutorial; would that other tutorials be as clear and concise as this one. I'm on a steep learning curve with GIMP but this helps big time. Thanks again.

  14. http://www.gimpusers.com/tutorials/mask-hair-strands.html Wed 25 Feb 2009 10:25:41 AM CET Emily, 25 Feb 2009 10:25 AM

    Wow... I've been looking for a good tutorial on how to render fine areas for weeks, and this is more helpful than I thought it would be(usually there's a lot of guess work with tuts). Very thoroughly explained-- thank you!

  15. http://www.gimpusers.com/tutorials/mask-hair-strands.html Fri 03 Jul 2009 04:46:21 AM CEST diosanne, 03 Jul 2009 04:46 AM

    wow!..it's great,,thanks for that tutorial.. that is helpful for me to mask a picture like that....

  16. http://www.gimpusers.com/tutorials/mask-hair-strands.html Fri 17 Jul 2009 12:43:37 AM CEST kirl, 17 Jul 2009 12:43 AM

    Thank you for taking the time to put this down 'in print'. Very helpful!!!

  17. http://www.gimpusers.com/tutorials/mask-hair-strands.html Tue 18 Aug 2009 07:07:03 AM CEST mahvin, 18 Aug 2009 07:07 AM

    Using the "Preserve Luminosity" setting along with the Monochrome setting on the Mixer takes out several later steps. Once an image is black and white, as preserving luminosity will create, your image is mask ready from that point.

  18. http://www.gimpusers.com/tutorials/mask-hair-strands.html Sat 03 Oct 2009 09:11:08 AM CEST khaled, 03 Oct 2009 09:11 AM

    i dont know >>>the name of these program

  19. http://www.gimpusers.com/tutorials/mask-hair-strands.html Tue 24 Nov 2009 03:00:08 PM CET danish, 24 Nov 2009 03:00 PM

    good

  20. http://www.gimpusers.com/tutorials/mask-hair-strands.html Wed 25 Nov 2009 10:10:13 PM CET kestrel4, 25 Nov 2009 10:10 PM

    I came to this tutorial after several hours of GIMP self-learning on the basics and found it very good.

    I am looking for tutorials on the more subtle stuff, getting the best out of a photograph, without it being obvious that it has been edited. Guidance, anyone?

    Thanks

  21. http://www.gimpusers.com/tutorials/mask-hair-strands.html Sat 06 Feb 2010 06:58:22 AM CET rahoof, 06 Feb 2010 06:58 AM

    hai

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 / Privacy policy | powered by bitfire it services