Straighten That Horizon and Keep Those Pixels
The above process is clean, neat, and works well BUT in that the photo has to be cropped, valuable pixels have to be discarded reducing the overall file size. Depending on how askew the horizon appears, sometimes multiple megabytes of pixels get tossed. Follow the process explained in this easy to follow tutorial and you'll maintain the original file size.
a) Find a photo with a crooked horizon. The image below is a full sized capture from my Nikon D300. Note the file size of 34.9mb and the fact the image is crooked.
b) Click On the Ruler Tool - (if it's not visible you need to access it via the Eyedropper tool using the toolbar fly out menu - click and hold the little arrow in the lower right corner of the Eyedropper box.) Move the Ruler Tool to the image and click, hold and drag the mouse across the horizon that needs to be straightened.
Along the top of the Options Bar, the amount of the angle it's off will be displayed along with the Straighten Layer button enabled. Simply click on the button and Photoshop will correct the horizon. You'll notice that cropping is now necessary to eliminate the grid of pixels in the background.
c) CROP the image but note the change in file size - it's now smaller - valuable pixels have been discarded. In the case of this photo, 2.5mb of info has been lost.
d) Rather than get rid of valuable pixels and reduce the overall file size, don't resort to the Crop tool. Instead, do a Select All and Transform the image. Here's How:
Right after using the Ruler Tool to straighten the horizon, hit Command A on a Mac or Control A on a PC to select the entire image. Marching ants will appear around its perimeter.
Then hit Command T on a Mac or Control T on a PC to Transform the entire image. A bounding box will appear. Pull the boxes outlined in red until the pixel grid in the background disappears as in the image below:
In the Layers Palette, you'll notice the Background Layer is now called Layer 0. Click on the little fly out icon to bring up the Flatten Image command. Drag the cursor to Flatten Image to restore the Background layer.
e) Here's the finished image with the straightened horizon - note the file is restored to its original size: