Clipping with GIMP
Raster image graphics editors are traditionally used for the purpose of cutting objects off an image. GIMP offers tools to clip images. Here's a few recipes.
Some commercial solutions come with plug-ins for this purpose. Photoshop provides specific tools for this too, but don't be fooled by Adobe's claims and various other tutorials: these tools aren't magic and you won't get a good result unless your original image was simple to mask in the first place, or unless you invest a lot of time semi-manually polishing your result. And that's something which you can very well do with GIMP too.
1 Clipping by Fuzzy-Selecting
- Crop the image to the bare minimum. We don't want to be tempted to uselessly spend time on portions of the image we'll get rid of eventually.
- Lock the pixels for the image layer.
Fuzzy-select the background. Photoshop tutorials will have you use another tool I can't remember the name of to actually select the object to clip instead. But it's just as simple to select the background if it's homogeneous.
Make sure antialiasing is turned on. It's quite convenient to keep the threshold rather low and repeatedly click on areas of the background which you want to select. Also, you may want to feather edges around hair-like subjects. Don't forget to select hair-enclosed holes too. It's not a problem to miss out hair, we can always fix that later by selecting portions again or directly painting the mask.- Create a new, transparent layer, invert the selection and fill it in pure green so the object to clip is covered in green. This way you'll be able to adjust the opacity of the green layer to refine the mask comfortably.
- Use the eraser to remove noise. Use different types of brushes with different hardnesses (go softer for hair). Don't hesitate to play with the layer's opacity.
- You may want to decrease the opacity of the green layer and further fuzzy-select holes between hairs. Note that hitting on the delete key multiple times expands the deletion area, which can be useful at times. Likewise, refine the mask with tools such as the eraser, the paintbrush and even the smudge tool. Decrease the opacity of tools to subtle levels.
- Once you're just about satisfied, set the green layer alpha to selection, add a layer mask to the original picture mask and initialise it to the selection. Create a pure green background in a separate layer to best assess the result. Unlock pixels and directly edit the original image mask to improve it. Use the x key trick to swap between foreground (black) and background (picture) to quickly add and remove pixels to the mask.
You may want to copy the mask to a separate layer again to see the masking area from the original picture and draw paths for some significant individual hairs. Note that you can draw many individual ones by shift-clicking to start new paths. Then, hit the Stroke Path button. Manually blur and partly erase them (especially the tips) to make it all a bit subtle.
You should have to spend about 20 minutes on a complex hair subject and 10 minutes on a simpler one.
2 Clipping by Changing the Contrast
This is per se not so different from the previous method, but it might be more convenient because you can see the result of what the outline will look like just by moving a slider, rather than changing a threshold and fuzzy-selecting multiple times.
- Duplicate the original layer.
- Move rulers to split your image depending on the brightness and the type of object (e.g. hair ≠ shirt). That's because the brightness differs from area to area in an image, and you'll need to adjust the contrast differently to highlight the difference between foreground and background and adjust the level of details.
- Desaturate the image. Choose shade of gray based on Lightness, for instance, although it doesn't seem to matter at this stage.
For each area, Adjust Brightness and Contrast, the goal being to set as much of the background to pure white and as much of the foreground to pure black as possible.
While you could Adjust Color Levels or Adjust Color Curves, these are unnecessarily complex for what we're aiming at here and brightness/contrast are really the only 2 parameters you need to play with.- Remove the rulers which will get in the way of the brush.
- Brush the bits of background which aren't white and paint the inner part of the subject black.
- If needs be, Adjust Brightness and Contrast multiple times and brush easy areas of the subject to make it turn black by itself. This would be necessary with light subjects.
- Copy the mask layer.
Add Layer Mask to the original layer. Paste to the mask. Invert colours.
Needless to say, this works best with subjects which are already in significant contrast with their background.
3 General Guidelines
- Use a mouse, so you can middle-click to pan and spin the wheel to zoom in and out;
- Set up GIMP to be able to change the brush size by spinning the mouse wheel, as it is very time-saving.