How to better crop a picture on Gimp

1

I would like to crop this picture, following the pattern of my hair/face/shoulders. I already did a rough cropping, but I want it to be more precise.
How can I do that?

enter image description here

Isabelle Dcps

Posted 2019-04-13T17:29:25.483

Reputation: 11

1Perhaps using the wand tool to select the white/cream background, then inverting selection? – QuickishFM – 2019-04-13T18:04:25.537

Answers

4

Preface

If all you need is to trim around the edges of you in the picture, simple outline selection tools will do it. I've included a few links below that will show you how to do it. It's straightforward and widely documented, so I won't address that here. You could even use the same tools you used to get this far, only work with some magnification and be more precise.

Typically, though, that doesn't give satisfactory results for this kind of picture because it ends up looking like a cutout, and the residual background that shows through your hair will look odd. Removing you from the background so the result looks natural is the hard job for which you may not find a good solution with some quick searching. That's what both nerdguy's and my answer focus on, assuming that's your objective.

Starting point

You've already done some rough cropping. A very minor point: you may not have been careful enough around your arms, the cropping looks angular. I'm going to suggest starting over with the original image, which will be much easier than working with this starting point if you use the right tools, and that will take care of any existing cropping issues.

With the current starting point, you can follow the approach in nerdguy's answer. He did a respectable job, and you could even improve on it if you put in a lot of time working at high magnification. The problem is that it is notoriously hard to make this approach look natural with people, and especially people's hair.

The initial cropping you've done actually isn't a good starting point because there is very little basis for tools to identify the background. You've also chopped off some hair detail, leaving an unnatural outline and lack of contiguous background. You would pretty much be limited to the kind of intensive manual approach nerdguy described.

Some GIMP resources

GIMP does contain a number of tools for removing the background. Doing that with the picture in the question is especially challenging, though, because of your hair and the quality of the image (I'll explain why, below), and GIMP's tools generally won't do a great job for your case. But I'll just quickly give you some links if you want to play with those and see if they're good enough for your needs.

  • This tutorial focuses on objects with simple, clean outlines. It includes some examples with hair, but the examples involve optimum photos -- simple outlines, sharp detail, great lighting and contrast, etc.
  • This tutorial includes an example involving "complex hair", but it starts with a near perfect, high resolution, professional photo using optimum studio lighting, so every detail is tack sharp. It doesn't have the challenges of your photo.
  • This YouTube video shows a very effective technique if you start with an extremely sharp image with very high contrast differences between the object and the background.

In general, you can improve the removal of background by using extra image layers to create a mask. For this purpose, you can build a selection through multiple steps, using different methods and tools in different areas. For example, outline-style selection tools for areas with simple, clean edges, and other tools for complex areas.

Accentuate any differences you can find between the object and the background. Luminosity and color are usually a good starting place. Switching to different color spaces can identify specific color channels with the biggest differences, and then color curve tools can maximize the difference. The objective is just to create a basis for a selection outline, as described in the links, above.

The Challenge

Hair isn't like a solid hat. There are endless gaps, "holes", and loose strands. Looking at someone in real life, you can see sharp detail that defines the hair. In a photo, you lose much of that detail and sharp edges. Unless the picture was taken with a very high resolution camera and good lighting, the image will contain a lot of averaging of adjacent detail.

A lot of the hair detail is averaged with the background in all of the little gaps. Every edge between hair and background has a border where some of the hair color is mixed with the background color. Instead of

hair | background  

you have

hair | blended hair+background | background

Some of the hair information is contained in the blended area. Individual and out-of-focus strands can be just a faint blur of hair and background colors.

Here are a couple of magnified snippets of hair from your image. Besides the blurred detail, notice that background shows through pervasively to varying degrees, depending on the density of hair in the area.

enter image description here enter image description here

At normal image size in the original, uncropped image, the background is part of what you see. Your brain recognizes that all of the little bits of similar color showing though the hair are part of the background. When you crop away all of the background surrounding the hair, every nook and cranny of the hair is still filled with background color. Without the context of the rest of the background, it makes the hair look weirdly colored.

It's almost impossible to delete all of the background that influences the color, at least without also deleting out-of-focus hair, which would leave holes. I captured similar snippets from nerdguy's image:

enter image description here enter image description here

Your brain knows what hair looks like, so it can make sense of the fuzzy detail in the original (uncropped) picture. If you put in enough time carefully deleting at high magnification, you may get a result that is good enough for your purpose. But without the visual context and subtle detail in the deleted background areas, your brain has a harder time recognizing it as hair. It tends to look more like a cardboard cutout of a frilly hat.

If you try to extract the person from the background, you aren't starting with a detailed picture of the person, you're starting with a fuzzy person blended with background.

If you try to delete the background, you get odd blocky, stair-step edges, and remnants of the old background color within the hair area. You also lose the smooth color gradients and gradual brightness changes, and get blocks that suddenly change to a dark color, but are actually background rather than hair. If you superimpose that on another background, the color difference will be obvious and look strange.

If you delete everything containing background color, that which is adjacent to hair includes the blended hair color. Deleting it will leave the hair looking oddly wispy and sparse, often with gaps and then random hair pixels in the background area.

Solution

For it to look natural, a very different approach can be used, and there is software that does that. Instead of deleting background at the edge of the hair, it identifies the colors that are hair and the colors that are background. It then converts the background color to transparency. The blended areas become hair color that fades to transparent. When you superimpose that on another background, it blends with the new background and looks natural. I say "hair", but it's really whatever you define as what you need to extract. This blog article describes the process using one of those applications.

enter image description here
In this example, the checkerboard pattern indicates transparency. In the original image here, you can switch between before and after versions to see the background removal.

Background removal software

I'm not aware of any free software that does this, but many offer a free trial, which might be enough to get the job done. Some are sold as Photoshop add-ins (I'm not aware of GIMP add-ins), and some as stand-alone software. You could do the background removal outside of GIMP.

You don't mention your OS, but Windows and MacOS are commonly supported. If you run Linux, you may need to hunt, or you may be able to run a Windows package in Wine. Search on "photo background removal software" or "photo masking software". To get you started, this article reviews five products that are Photoshop plug-ins, but many of these are also stand-alone, and some work as plug-in for other image software (although I didn't spot GIMP specifically mentioned).

There are also some free online services that will remove the background from your images. With any service, the results will be affected by the image they start with. They will do a better job with a sharp, high-contrast image.

Remove.bg is one. It's described here (AI-based and completely automated; you just give it an image and it figures out what areas are background). Just out of curiosity, I tried your image from the question. Unfortunately, your cropping confused it. You could try submitting the original image.

fixer1234

Posted 2019-04-13T17:29:25.483

Reputation: 24 254

3

Use the Fuzzy selection (Magic wand) tool to select the leftover parts of the background, then click the delete key.

Here's a quick example of what the tool can do but you should keep testing and zooming in and removing more and more of the noise you do not want to show. enter image description here

nerdguy

Posted 2019-04-13T17:29:25.483

Reputation: 53