Sunday, September 6, 2020

Removing Annoying Foreground Fence

 As I have been working on my shots from a family trip to Alaska in 2006 I ran across some interesting shots that were totally ruined by nasty foreground fencing.  All of the images are from an animal park, taken through the fences, also as I was with a tour group I was forced to shoot through the fence.  I captured images with a fence dominating my view but I remembered just seeing the animal.  Rather like the following pair of images.

After a bit of wandering on the web I came across a video on the PixImperfect channel of YouTube that suggested a technique that totally worked for me.  Below is a link to the video.  The remainder ofthis post will set through my useof the technique on a sample image. 


Example

By the time I realized I should document my process for this technique, I'd already done my four most obvious candidates.  They all had a clearly visible, almost in focus, fence blocking the subject similar to the fox shot that started this posting.  This technique seems to work best with focused or nearly focused foreground obstructions.  If the fence is way out of focus it diffuses across a large area and can be very hard to cleanly select and not take out too much of the image. 

My fifth most promising candidate is a shot of a critter (I'm not certain what type of animal) located behind a mostly blurred fence.  


The fencing is clearly visible as vertical and horizontal lines in this image and really ruin it.  Even using this small in a photobook is going to annoy me, so it really does need help.  

Create a Layer to be used as a Mask

After moving this image into Photoshop, I created a blank layer above the background.  I then picked a hard edged paintbrush large enough to cover the entire width of the objections part of the fence.  Using that brush, I painted over the portions of the fence that really bothered me. 


I made use of a nifty trick to paint straight lines: left click at the start of a segment and then shift-click at the end, adding on more segments with additional shift-clicks.  This makes following the mostly straight   segments of the fence easier. 

As I covered the fence, I noticed that portions of it were sufficiently blurred across "friendly" background elements that I could barely find them and I opted to not mask them.  I would just let them remain and see if they were sufficiently subtle to remain in the image. 

Use Painted "Mask" Layer to Make Selection

At this point I had my background and a layer containing a black painted mask, that wasn't a mask at all, but would serve that purpose. Here's are the two rather fiddly steps:
  1. Select the background (or a copy of the background - ⌘J) by left clicking it to make it the currently selected layer.
  2. Cmd-Left-Click (⌘Click) on the thumbnail for the "Mask" layer.  You should see marching ants that indicate the selected area which corresponds to the paining in the "Mask" layer.
That selection should be what you want to replace in the picture.

Use Content-Aware-Fill to Perform Magic

Click on the Edit drop down from the top menu, then click on Content-Aware-Fill... to start the filling process.  You should see something like this:


Your screen display will change while Photoshop computes the replacements.  This can take a few seconds.  When it has finished, you should see something like this: 


The large left frame is showing your image with green overlaid on portions that are being sampled. You can modify the sampling areas with pretty typical brush commands.  

The smaller, middle frame shows a preview of the results.

The right-hand frame contains controls that allow the substation to be tweaked.

I'm pretty happy with my preview, so I just went ahead and clicked Ok and Photoshop spins for a moment and returns my updated image with the filled pixels in a separate layer (new layer is the default for this tool).

Results Could Be Better

The change is pretty dramatic, but as usual, it could benefit from a bit of touchup.  In my example, the part that bothered me was the pattern on the animals lower flank that I hadn't painted over with the mask.


I could go back and add to the mask layer and repeat the fill, which in this case should work pretty well.  But since the areas I was concerned about were small, I opted for using the spot healing brush.

Specifically, I did the following (for safety should I not like my results): 
  1. Merge All Visible Layers on to New Layer (Cmd-Opt-Shift-E) 
  2. Moved the new layer to the top of the stack 
  3. Painted on fixes with the Spot Healing Brush
Of course, any other changes could be made at this point.

Back to Lightroom

I then saved my image and flipped back to Lightroom.  In Lightroom I added a minor vignette (-12) and decided that my image is now good enough for use in my next photobook.  It'll still be small, but now it will not bother me. 


Thinking about it, I may well flip this back to Photoshop to do some selective focus and adjust lighting to further reduce the still slightly visible mesh.  If I do, that will be the subject of a different post.











No comments:

Post a Comment