There are many ways to achieve certain goal in image editing. Each photographer might has different method to change the background color of the photo, but the key remains the same. You need to turn the background area to the transparent mode while retaining the base part. Once you did it, you can fill the transparent area with any image (or color) you want to change the background.
To remove the background area, you need to select it first using the available selection tools and add alpha channel to the selected area. GIMP has a several selection tools, you can choose the one best suited on the image you want to remove its background. On this example, I am going to two selection tools: Fuzzy Select Tool and Scissors Select Tool. Following is the photo I want to take as the example in this tutorial.
Step 1: select the background area and make is transparent
Once you loaded the photo you want to change its background, the first thing you need to do is to select the background area. The tool you are going to need can be vary depends on the background composition. If your photo is a passport photo (like the example above) which typically has a flat background color, you can use Fuzzy Select Tool. This type of selection tool will select areas based on color similarity. I also use the additional selection tool, Scissor Select Tool, in this example to select the shadow area.
Once you selected the background area, add the alpha channel by clicking the Layer menu and select Transparency –> Add Alpha Channel.
Lastly, remove the background by clicking the Edit menu and select Clear.
Your photo should looks like the following.
Step 2: add a new layer
Now that you have removed the background area of your photo, it’s time to create a new one. In this example, I will use the red background. If you want, you can also blend your photo with another photo.
Since I want to use a red background, I need to change the default background color to red before I create a new layer.
By now I can start to create a new layer. To do so, simply click the Layer menu and select New Layer. Or, you can also click the “+” icon at the dockable dialogs area. On the appearing dialog, select Background color.
Step 3: change the background
Now that you already have two layers, you can start applying the new background. To do so, right click on the layer of your new background and select Flatten Image.
Alternatively, you can also change the layer order by putting the layer of the base image above.
Following is the end result.
Done. You can now export the edited photo. To get a better result, you can use a combination of selection tools to remove the more detailed parts of the background area at the step 1 above.