Metuchen High School: GIMP


Changing a Background

8 points


You can use GIMP to change a photo's background.  The process is very similar to cloning. 


This is an example, meant to show you how replacing a background works.  You are not expected to do this example.  The exercise you are asked to do is below.

Here are two photos.  The one at left is of the German boxer Max Schmeling.  The one at right is of a wall.

Open the two images in GIMP.  For the boxer photo, do CTRL-L to open the Layers dialog.  Copy the photo of the wall, and paste it into the Layers dialog of the boxer photo.  You will see a layer named "Floating Selection (Pasted Layer)" show up.  Right-click on this layer and choose New Layer.  The name of the layer will change to "Pasted Layer".  Each photo now occupies its own layer.  Use the up arrow at the bottom of the Layers dialog to move the boxer photo up to be the top layer.

You want to resize the photo of the wall so that the it is at least as large as the photo of the boxer  To do this: right-click on the boxer layer and choose Scale Layer.  Make a note of the dimensions of the layer.  Then right-click on the wall layer and choose Scale Layer.  Modify its dimensions so that it is at least as large as the boxer layer. 

At this point both layers are opaque, so only the boxer is visible.  A layer mask can be used to make part of a layer transparent rather than opaque.  Add a layer mask to the boxer layer.  To do this, in the Layers dialog right-click on the boxer layer and choose Add Layer Mask.  In the Add Layer Mask dialog box, choose White and click Add. 

If you paint on a white layer mask with a black paintbrush, you remove the opacity where you paint, allowing the other layer to show up.  Click on the Paintbrush tool in the Toolbox, change the foreground color to black, and set the size of brush you want to use.  One approach would be to begin with a small brush size.  Paint, slowly and carefully, around the edge of the boxer.  Paint outside the shadows so that the shadows remain.  Once you have the boundary of the boxer painted, switch to a larger brush size and paint the rest of the background.  Paint with a series of small strokes, rather than one long stroke, so that if you make a mistake it is easy to hit CTRL-Z and undo the mistake. 

Here is the result:

Find an image whose background you'd like to replace.  Find a second image that you'd like to use as the new background for the first image.  Get my approval of the two images before you begin.

Follow the procedure above to replace the background of the image.

GIMP Links


Videos (has sound) (has sound, starts at around 0:20)