Re: [Gimp-user] Change background and leave foreground



On 10/26/2012 11:10 AM, Alexandre Prokoudine wrote:
Fran,

The general principle is:

1. Select objects with selection tools.
2. Cut and paste them to a new layer above the original layer
(Ctrl+X, Ctrl+Shift+V).
3. Change the background layer so that the object are unaffected.

There are many ways to select objects. I suggest you have a go
at http://docs.gimp.org/2.8/en/gimp-tool-foreground-select.html.

This can also be done using layers and masks, which would be my
preferred method - due to force of habit, and the low contrast in
brightness and color between some parts of the foreground &
background in the photo in question, making automated selection
tools more difficult to use.

This is much easier than it sounds:

Open your image file in the GIMP, and find the Layers dialog in your
dock area.  Make a new layer, and fill it with the color, pattern,
or etc. that you want for your background.

At the bottom of the Layers dialog, use the down-pointing arrow
button to move your new layer below the layer with your original photo.

In the Layers dialog, right-click the layer thumbnail for your top
layer (the original photo) to open a menu.  Select "Add layer mask"
from that menu, and accept the default "White" which will leave the
photo layer fully visible.  Left click on the new mask thumbnail
(the one on the right) to make sure it's selected.

Then make sure your foreground color in the color selector is black,
turn on the paintbrush tool, and in the main image window start
painting around the outer edge of the items you want to keep in your
photo layer.  Everywhere you paint with black, your new background
will show through.

If you accidentally wipe out part of your foreground object, just
change your painting color to white and paint with that to bring the
missing bits back.  This is one big advantage of using layer masks,
compared to working with pasted selections or deleting selected
areas of a layer - you can adjust or undo details of your selection
at any time.

Enlarge the image with the magnifying glass tool (or, better, hold
down your ALT key and scroll your mouse wheel), for better accuracy.
 Also remember that you can paint a straight line by holding down
the shift key and clicking your mouse - "connect the dots" saves a
huge amount of time and stress.

Once the outline is done, use the "Magic Wand" tool to select the
whole area outside where you were working.  Do Select > Grow to make
sure the edge of your outline is included in your selection area,
then drag and drop black from the color selector to the image window
to finish painting your mask in one step.

Save the file in .xcf format in case you want to work on it more
later, save the file in the format you need to publish it, and yer done.

A variation:  Instead of making a new layer and filling it with one
color at the start, use the button to make a copy of your existing
photo layer at the bottom of the Layers dialog.  Then use the tool
at Colors > Hue/Saturation to turn up the brightness of your
background, ignoring what it does to the parts you don't want to
change.  The proceed exactly as above:  Lower the altered layer,
mask the original photo layer, and paint with black to make the
altered background visible only where you want it.  The end product
might look a whole lot better.

:o)

Steve









[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]