How to Change a Background Color in Photoshop

 
 

Hi Everyone! Today I am going to teach you a quick way to change a background color using Photoshop or a similar image editing software (My favorite free Photoshop alternative is GIMP).

p.s. In a few weeks I will be launching a "Photoshop Essentials for Small Business Owners & Creative Entrepreneurs" Course. In this course I will teach you how to maximize sales and social shares by creating beautiful product images, mockups, and more! This course is perfect for all skill levels and I will have video lessons devoted to both Photoshop and GIMP. Be sure to sign up for course registration updates here.

Why do this in Photoshop?

Of course taking actual pictures will give you the best result, but we can get an extremely realistic look with Photoshop in very little time. Plus with Photoshop we can choose colors exactly and if you want to change a color it is literally one click away.

If you are frequently posting high-quality images on sites like Instagram or Facebook, changing the colors is a great way to modify your photos and get more use out of them without boring your followers or customers. You can customize your photos to match your branding exactly, change your color palette with the seasons, or just have fun and mix things up.

How does it work?

Note: for this tutorial I deliberately chose a low-tech way of taking my base photos - with my iPhone standing on a kitchen chair. No fancy lighting, no fancy camera. The purple background is a large sheet of colored paper that I picked up at a local art supply shop.

Now I have seen a lot of “photoshop fails” in my day and I would never subject you, dear reader, to that fate. The fastest and easiest way to get an extremely realistic effect is to use Chroma Key Compositing or, as you are probably more familiar, Green Screen Technology. What this means is we can tell Photoshop to select every pixel that has a certain color and then we can apply color changes to only those pixels. Not only does this take seconds to do, but we don’t loose essential shadows or reflected light.

...But you don’t need a green background!

The reason green is so widely used for this method is because lime green is never found in natural skin tones; it would be pretty creepy if half of your weatherpersons face was gone during the morning weather report. When it comes to photos we can tell photoshop to replace any color, even white.

How to pick the best initial background color

If you have not taken your base photos, choose a background color that is very different from all other colors in your image; this will make isolating that color as easy as possible. For my image, I chose a dark purple color. Note: if you are planning to have light background colors, choose an initial background color that is on the lighter side. I was able to take my dark purple initial color to a light rose, but it required some cleanup work at the edges.

If you already have images that you want to edit, don’t worry about retaking them. If your background color exists in other elements of your image, you may just need to do a bit more cleanup at the end.

Changing the Background Color

There are 5 steps necessary to change a background color in Photoshop:

  1. Make any initial edits to your image (e.g. straighten, crop, etc.)
  2. Isolate the original background color with a layer mask
  3. Shift the background to a new color
  4. Clean up the edges of your mask so that no original background color remains
  5. Save & export your modified image

Bonus Step: Bask in your awesomeness...then change the background to a pattern with the bonus lesson

Okay, let's go through these steps in detail. If you want to work with the same image that I use in this tutorial, download the JPEG here.

1. Initial Edits

For my image I did not have any initial edits to make, so at this point I have my one image on one layer ("layer 0") in Photoshop:

*When you first open an image with Photoshop it will be on a locked layer called "background." Simply click the lock icon to unlock it and then the layer will automatically rename itself to "layer 0."
 

 
Initial Image in Photoshop
 


2. Isolate original background color with a layer mask

Now, right-click on "layer 0" in the layers panel and select "duplicate layer." If you want, you can give this new layer a name; I chose "isolated BG" because this layer is where we will isolate all of the dark purple pixels. Your layers panel will now have two layers, like this:


With your top layer selected ("isolated BG" in my case), go to Select > Color Range in the top menu. This will bring up a selection dialogue box. In this box we will tell Photoshop to select certain pixels based on their color. 

"Select By Color Range" Settings

We have several options here so I will go through them one by one:

  1. Select - In this dropdown we can tell Photoshop to select all pixels of a predefined color (for example all reds, greens, skin tones). For this tutorial, we will use "Sampled Colors." This means that we will use the eyedopper tool to choose the specific background color we want to isolate.
  2. Localized Color Clusters - Leave this unchecked.
  3. Fuzziness - This controls the sensitivity of our selection. After you have selected some colors with the eyedropper, you can slide this around to see if it helps.
  4. Thumbnail - This is either a preview of your selection or a thumbnail of the "isolated BG" layer.
  5. Selection/Image Button - This changes what is shown in the thumbnail. You can toggle between these two if you wish, this is for convenience and whatever mode you choose will not affect the selection itself.
  6. Selection Preview - Set this to "greyscale." Your image will change to greyscale; anything white is selected, anything black is not selected.
 
 

7. Eyedroppers - Use the eyedropper(+) tool and click on your background color in the thumbnail or main image until you have selected all of the different shades of the background color. Similarly you can use the eyedropper(-) tool to unselect some colors (like if I accidentally selected something black). You are done when you have as close to a black and white image as possible. The areas that you want to change should be WHITE and the areas that you want unchanged should be BLACK.

 
 

If you have a few areas of grey that is totally fine, we will take care of those pixels in step 4. When everything is black and white, hit "okay" and you will see your selection appear, like this:

 
 

You can see that there is a dashed selection line that encompasses all of my purple pixels. With this selection active (if you unselect, you will need to recreate this selection using the method in the previous step) click the "new layer mask" icon (white rectangle with a black circle inside) at the bottom of your layers panel.

 
 

Now the selection has been used to make a layer mask. What this means is that on our "isolated BG" layer, anything that isn't purple is completely transparent. Now we can shift the purple to something else without affecting the other elements in our image. Furthermore when we shift the background color in this way we maintain the different tones in the background; the shadows and highlights are preserved. 

3. Shift the background to a new color

Cha-cha-cha-changes. With the full-color thumbnail on your "isolated BG" layer selected, add a "Hue/Saturation" adjustment layer by going to Image > Adjustments > Hue-Saturation.

 
 

This will bring up a color dialogue box. Be sure that "colorize" is checked and that you "pin down" this adjustment to the "isolated BG" layer by clicking the [white square with a down arrow] icon at the bottom of the dialogue box. If we don't pin down this color adjustment, the color shift will affect the entire image and all of your layers instead of only this one. Now have fun! move the sliders around until you have a background color that you like. You can also set it to a specific color by typing in the Hue, Saturation, and Brightness values of the color you want.

4. Clean Up

After you have adjusted your colors, you may notice some of the initial background color showing through. This happens in places where our layer mask wasn’t perfect. For me, I noticed some of the dark purple showing through around the bottom edge of my black folio.

 
 

What is happening here is that around this pull tab some of the background is showing through and some of the tab itself has been "erased". Whenever this happens I will start by selecting my "isolated BG" layer mask and painting this area with BLACK (black paint on our layer mask allows the original colors of the image to show through). This makes it easier for me to see what I need to fix and it will restore the erased parts of the pull tab.  

 
 

Now I will use the polygonal lasso tool to make a shape that encompasses all of these purple pixels. 

 
 

Using a tool like the polygonal lasso allows me to get really close to the edge of the folio and it makes this final step a breeze! One nice thing about Photoshop is that whenever you have an active selection the paintbrush will only work within that selection. So now I can take a huge sloppy brush and paint this selection with WHITE paint. Since the paintbrush only works within the selection I can get right up to the edge of the folio and pull tab. This white paint will restore the layer mask in this area and the new background color will be restored.

 
 

5. Save & Export

Yay! You have changed your background color and you are totally ready to take it to the next level with some patterned backgrounds. Enter your email below when you are ready and I will send you the bonus lesson.