Remove unwanted passersby in your perfect travel photo

A lot of us have been through this while travelling. You have the perfect angle of the landmark or building but there are too many tourists or people in the photo. You probably won’t be getting a clear good shot because it’s already midday and tourists are streaming in.

Fret not, with photoshop, anything is possible. You can now post your perfect photo on facebook or instagram and your friends will go “wah, what time did you visit that place? how come there isn’t anyone there?”

So here you go, the secret sauce in every photo that looks too perfect.

First, you will need to take 8-15 photos of the same shot. These photos should best be taken on a tripod. If you are not carrying one, hold your camera as still as you can or lean it against a support.

Space out each shot long enough for the moving objects like humans and cars to move along. Take 10 photos about 20 seconds apart from each other.

Once you’re done, you can now move on to the photo editing part.

Open photoshop:

Long way (for learning purposes)

  1. Go to Files > Script > Load files into stack > Navigate to your photos
  2. Select all Layers and use Edit > Auto-align layers > Auto
  3. Select all Layers and right-click > Convert to Smart Object
  4. Lastly, go to Layer > Smart Objects > Stack Mode and choose Median
  5. Crop the edges of the photos off if necessary

Shorter faster way (for lack of time)

  1. Go to Files > Script > Statistics > Navigate to your photos
  2. In that window, make sure Median mode is selected and auto-align checkout is checked
  3. TA-DA!
  4. Crop the edges of the photos off if necessary

For those who are interested in what goes behind the scenes. Here’s the explanation.

It’s actually all math. Let me try to break it down for you.

Step 1: The auto alignment of all the photos is done by photoshop analyzing the source images and uses 2 methods (perspective or cylindrical layout) and it chooses the one that produces a “better” result. It tries to overlap the same content across the multiple layers and applies different forms of adjustments to create that overlap.

Step 2: The second part is the part that looks like magic. Now that all the images that you took are more or less aligned to each other, the static objects (roads, buildings) should be in the same position across the different layers. The moving objects, in this case passersby, are still present in the different layers at different positions. So what Median Blend does is to look at each layer and for each pixel in the layer, choose the median channel value. Eg, Given a specific x and y-coordinate in the stacked layers, there will be 5 sets of channel values across the 5 layers, (R1,G1,B1), (R2,G2,B2), (R3,G3,B3), (R4,G4,B4), (R5,G5,B5). Photoshop will order all the Rs, Gs, and Bs in sequence and choose the middle value and end up with one (R_median, G_median, B_median) value. All these median values for all the x and y-coordinates of the photo will form the final photo. Chances are that these median values will be the ones where there are no moving parts in them. This is also why more photos or more sets of channel values will produce a better result.

Details can be found here: Adobe Photoshop: Align and distribute layers.


Here are the demo photos: 2 people (orange and blue shirt) walking across a park, and then a guy in red walking in another direction.



And this is after using the method I described above in photoshop. Notice the black edges? These are the parts for you to crop off. There are black edges because I didn’t use a tripod and each of the photos I took are at slightly different angle, so they weren’t a perfect match.