This type of project is known as an ‘out-of-bounds’ piece, where the subject of an in-frame photo or painting continues into the foreground setting. It makes for a very engaging and dynamic composition. Bridges, waterfalls and piers often appear in such projects as these elongated subjects easily span the two areas.
The first instinct you may have when approaching this type of project would be to try to extend the subject itself. This is very difficult to achieve believably. It’s easier to actually use a foreground image to crop down the subject and then just reveal the extended portion.
The basic strategy is to have the subject layer beneath the foreground layer. Then use a layer mask on the foreground layer to remove the photo area, revealing the subject behind it. Create a copy of the subject layer and move it above the foreground layer. Carefully select the extended area of this new layer and use that selection as a layer mask to reveal the original extended area.