Home » Tutorials » PTPerspective

Tutorials
PTPerspective Photoshop Plugin
There may be well more user friendly tools for correcting perspective but PTPerspective, based on the legendary Panotools engine developed by Helmut Dersch and now available from Thomas Niemann at Paperpress, is a precise, free 16bit Photoshop plugin that is a handy addition to any photographer's toolbox - an oldie but a goodie!

This tutorial looks at correcting vertical pitch/tilt problems commonly encountered when shooting architecture using PT(Panotools)Perspective. If you have Photoshop CS2 you may want to look at using the Lens Correction Filter - Filter > Distort > Lens Correction - instead of PTPerspective.

Introduction
The shot below is an example of a classic problem when photographing architecture - you often have no way of magically rising/lowering the camera to the desired vertical midpoint of the structure you would like to photograph to achieve the desired composition while keeping the vertical lines in the image upright and making use of all the data captured on your camera's sensor. Even an expensive shift lens might not be enough.

Before and After - PTPerspective

In my example, I could stay on the ground and take the shot keeping the camera vertically aligned with the building and use only (the top) part of the frame ala a shift lens - but sometimes the trade off in net data captured is too great. Why not pitch the camera up (or down) as required (within reason), shoot a little loose while capturing as much data as possible and correct the pitch later on?

Correct Pin Cushion & Barrel Distortion first
So you've taken your interior or exterior shot and are back in Photoshop ready to go. Before correcting pitch/tilt problems with PTPerspective it is often worth running the image through a tool like PTLens (also free from epaperpress) to correct any pin cushion and barrel distortion - problems present in varying degrees in most lenses. This step may not be critical with landscapes but for architectural shots, full of lines that are typically parallel and/or dead straight, it can be very useful. Refer to the online manual for PTLens for further information.

PTLens

 

Make Room, Add Canvas
PTPerspective crunches the numbers to precisely distort the image to correct perspective problems and in doing so pushes parts of the image outside of the original dimensions of the file, which is then lost. This is a problem because you need to crop the image afterwards and to do this effectively need to see all the data.

To get around this before we open the filter we need add some working area around the image using the Canvas Size (Alt+Cntrl+C or Image > Canvas Size). How much to add all round? This is a guess and will depend on the amount of pitch you need to correct - err on the side of too much. Also PTPerspective has no understanding of transparent pixels so you will need to have a flat file i.e. the image as a Background in the Layers palette.

Image with additional canvas

PTPerspective Plugin Interface
To run PTPerspective go to: Filter > ePaperpress > PTPerspective

PTPerspective Plugin

1. Preferences
The first time you run PTPerspective take a look at the Preferences available. The defaults work fine but you might want to bump up the interpolation method. Click the Prefs button, then click More to access the Bicubic Interpolation Options.

Interpolation is a complex topic, read about it at Wikipedia and decide for yourself how much speed you will trade for a better quality result - testing different settings with the same image is recommended. I usually run at Spline/36, YMMV. Preferences are retained, so there's no need to revisit Preferences each time you use the filter. With that decided, return to the main PTPerspective dialogue.

2. As Source
PTPerspective does not automatically inherit the size of the active file in Photoshop. Click As Source to make sure it's set correctly to the size of the file you are working on.

3. Unit for turn
I think and work in degrees when it comes to correctly pitch problems, probably from having shot a lot of multi-row panoramas where the camera is pitched/tilted up, level and down at varying degrees.

4. Vertical
Set a positive or negative value for the number of degrees for the image to corrected i.e. the opposite of what you did with the camera when taking the shot - to set the image back to 0 - so the verticals will be perfectly vertical again. This is a best guess with no preview. PTPerspective doesn't take long to process images so trial and error is not a big deal.

Click OK to run the filter. A dialogue displays progress, which is usually fast, along with resource usage.

Assess and Crop
Back in Photoshop assess the result. You'll be able to see immediately whether or not you added enough working space around your image to accommodate the correction and still be able to see the entire image.

If it's good to go, I toggle on either guides (Control+;) or the grid (Control+') as assessing vertical lines by eye can be hit and miss.

If I haven't corrected the pitch exactly as I'd like I Control+z (undo) and Control+F to reopen the filter and change the number of degrees - better to correct it in a single pass vs running the filter multiple times on the same file.

When the correction looks good, it's time to crop. It should now be obvious why shooting a little loose initially is a good move - giving you more room to move when cropping the corrected image - some of the image is going to be removed as part of that process (my example is a little on the tight side). Once done, you can return to your usual processing workflow.

Conclusion
So you might be thinking 'Sheez that seems like an insane amount of work to correct a basic problem, I can do the same thing with the Free Transform tool in Photoshop a lot quicker'.

Firstly, the PTPerspective process above is very quick once you're familiar with it - correcting the image in this example took less than a minute.

Secondly and more importantly - PTPerspective is exact and objective - it comes down to maths, distorting the image exactly for the set amount of degrees. With the Free Transform tool it's your best guest - how much to keyhole, how much to alter the height of the image etc. I would rather be exact, especially with architecture.

Thirdly, if you're inclined to measurebate - the interpolating options available in PTPerspective are arguably more sophisticated than those available in Photoshop which apply to the Free Transform tool and should yield a superior result.

I've found PTPerspective to be very useful, I hope you do too.

Enjoy!

Pete Walsh
Magicpixel

All Images © Pete Walsh 2005
Pete Walsh, Photographer