Prevention is usually better and easier than a cure. This is the case with straightening images. Straightening images is a two step process. First, the photo is rotated to level the image. Second, the image is cropped so that the image will again be rectangular. Both of these tasks create their own problems.
Rotating the Image: When an image is rotated, Photoshop has to figure out the new color value at each pixel. It does this by interpolation. Any time interpolation is used, some degree of image degradation occurs. So, the image quality of the rotated image will not be as good as the original image. This is true for all rotations except for 90o and 180o rotations (90o and 180o rotations do not use interpolation).
Cropping: Cropping is a double whammy. First, anytime an image is cropped, pixels are thrown away. Thus, for any given size print, there are fewer pixels (i.e., less data) to spread across the print. This will result in lower image quality. Second, cropping changes the composition of the image. Most experienced photographers tend to fill the viewfinder with the image. In other words, they know what they want and they compose accordingly. They do not leave a lot of extra space along the edges. This results in the highest quality image. However, if the image is subsequently cropped, the composition could be destroyed. Some important object toward the edges could get cropped out of the image or get cut off in the middle.
Therefore, whenever possible, one should attempt to ensure that the camera is level before the image is taken. Luckily, this very easy and relatively cheap. The solution is a bubble level. Shown in Figure 1, a bubble level is essentially a carpenter's level redesigned for a camera. It fits into the hot shoe of the camera (there are also models that mount onto the tripod, but they only guarantee that the tripod is level, not necessarily the camera). These levels work extremely well. There have been times when I was convinced that there was something wrong with my level because the level's reading conflicted with my own appraisal of the situation. However, the level has always been correct.
In order to straighten an image, the image must be rotated. As mentioned above, rotating an image requires the image to be interpolated. Thus, it is desirable that the best interpolation algorithm available be used. The interpolation method is set by choosing Edit/Preferences/General. The Preferences dialog box appears as shown in Figure 2. I recommend that the Image Interpolation be set to Bicubic or Bicubic Smoother. Clicking OK closes the dialog box.
Figure 3 shows an image with a horizon. The horizon appears to be tilted. However, it is better to get a more accurate evaluation. For this, a guide is used by choosing View/New Guide. The New Guide dialog box appears as shown in Figure 4
The Measure Tool can be used to level the image. The Measure Tool is selected from the Tools palette as shown in Figure 9. The Measure Tool is then used to draw a line along the horizon (see Figure 10).
To crop the image, the Rectangular Marquee tool is chosen from the Tools palette (see Figure 14). Once the Rectangular Marquee tool is selected, the Rectangular Marquee Tool options will appear in the Options bar (see Figure 15). In the Options bar, the New Selection option is chosen, Feather is set to zero, and anti-alias is unchecked. Three options exist for style.
Normal: Allows any size of rectangular shaped selection.
Fixed Aspect Ratio: Confines the shape of the selection to a rectangle that has a specified width-to-height ratio.
Fixed Size: Confines both the size and shape of the selection to a rectangle of a specified width and height.
For this image, it is important to keep the original 1.5 width-to-height ratio. Thus, the Fixed Aspect Ratio option is chosen. The Width is set to 1.5 and the height is set to 1.0.
Another method of straightening images is the Lens Correction filter. An advantage of the Lens Correction filter is that it allows the image to be rotated and cropped all in one action. A word of warning before you start: I suggest that you perform this method only on images that do not have multiple layers. If an image already has layers, the image should be flattened before this technique is used. Using this technique on images that have layers is likely to produce a ghosting effect around objects.
Figure 18 shows another image with a slanted horizon. To correct this problem, the Lens Correction Filter is launched by choosing Filter/Distort/Lens Correction. The Lens Correction dialog box appears as shown in Figure 19.
Selecting the Zoom tool and clicking on the image enlarges the image. The grid allows the horizon to be checked to determine if it is level. Figure 20 shows a close-up of the image that shows the tilted horizon.
To prepare for straightening the image, the grid is removed for easier viewing by unchecking Show Grid, and the Edge is set to Transparency. The Straighten Tool is chosen from the dialog box and is used to draw a line along the horizon (see Figure 21).