How many times have you taken a photo of a building (trees can to troublesome too) and found that the walls are sloping inward as they rise. This is called “converging verticals” or “keystoning” and is the result of tilting your camera upward to get the building in frame. You can avoid it by going further back and zooming in, as you will not have to tilt the camera upward.
To correct it when it does occur is quite easy, I have selected a photo of a old ruin near where I live as it shows quite a pronounced example of this effect, unfortunately I could not go back any further due to my aversion to rusty barbed wire. To correct this, open your image and…
1. Move you mouse to the bottom of the left corner of the building, note the coordinate given at the bottom of the screen.
2. To add a guide line drop the dropdown menu select Image > Guides > New Guide. In the ‘Script-Fu New Guide’ dialog box select Vertical for the ‘Direction:’ and for the ‘Position:’ enter the coordinate you noted in step 1.
3. Repeat steps 1 & 2 to add a guide on the right hand side of the building. I added one at the back right corner because it was easier to see against the sky.
4. From the ‘Toolbox’ select the Perspective Tool and then mouse click in your image.
5. With your mouse, click and drag the top corners of your image outward. You may need to go back and forth between to two corners as moving one affects the other. When you are happy select Transform
6. Turn off the guide by selecting Image > Guides > Remove all Guides
7. Flatten your image by selecting Image > Flatten Image