Digital Darkroom: Correcting Lense Distortions

Thursday, November 20th, 2008 | Filed under Lessons

Lense distortions can be found in photos that have been shot using a wide angle lense (sperized effect, barreling) or they can be perspective distortions cause by not standing right in front of the subject as well as tilted images or vignette effects. This article will cover methods to remove these distortions both “traditionally” as well as using the Lense Distortion Filter available in PS CS3 and up.

Content:

  • Everything in one place: PS CS3 and up
  • Correcting Lense Distortion “old style”
    • Removing the Spherized Effect (aka “barreling”)
    • Removing Unwanted Perspective
    • Straightening Crooked Images

Everything in one place: PS CS3 and up

In Photoshop CS3 and up, a very handy tool is available to fix all these things within one filter dialogue. Just go to Filter > Distort > Lense Distortion and you’ll find all you need in one place. The following video tutorial explains how. Even if you do not have a Photoshop version that includes the lense distortion filter, you may still want to watch as the basics are the same for older versions (more on those below).

Correcting Lense Distortions Video Tutorial
I recommend viewing the high quality divX version, not the flash version.

Correcting Lense Distortion “old style”

As mentioned above, older Photoshop versions don’t come equipped with the lense distortion filter, but they still have all the tools to correct distortions of all kinds.

Removing the Spherized Effect (aka “barreling”)

Preparation: First open your picture and unlock the background layer (double click on it so a dialogue pops up with “Name: Layer 0″ – just click OK and you’ll find the layer has been renamed and the lock has vanished). I chose a brick wall picture to show you the distortion. If you look at it, you can see the lines curving upward at the top and downward at the bottom. To correct this, first make the canvas bigger using Image > Canvas Size – there is no set value that will automatically yield the best result here. It depends on your camera and how far away from your object you were standing. My camera shoots at approximately 3000x2300px and I set the new canvas size to 4000x3000px. I make the canvas bigger than the image I work with to give the Spherize filter (see next step) more room to work with – if the image is left in its original dimensions, I often find the filter doesn’t catch all the distortions because it will not reach the corners well or at all.

ex2
Result after running the spherize filter
- note the bend edges of the image

The Spherize Filter: The next step is to go to Filter > Distort > Spherize. The Mode at the bottom should be set to “Normal”, the amount at the top needs to be tweaked according to your image. In my experience, even though I always use the same camera, I can’t always go with the same value which is probably due to the distance from lense to object that varies each time. One thing you should keep in mind is that you always need a negative value in the field (a positive one will just blow it up even more) and that less is in most cases more. For me, values of around -11 to -3 have worked in the past, though -11 is already a big distortion to work with. For this picture, -8 was okay as the effect was rather prominent.

Tip: If you don’t know what will work yet and the preview isn’t helping much either, just hit okay and look at the result. You can always use the undo-function (Ctrl+Z or in the History Palette) to try again with a higher or lower value. With a little experience, it will go faster in the end :)

Lastly, you just have to use Canvas Size again to crop the picture so the now bend edges won’t show any more. I usually go with something just a tad smaller than the original image dimensions – in this case 2900x2200px

Removing Unwanted Perspective

Using “Free Transform”: If you look at the result from above, it still doesn’t look perfect: even though the lens distortion is gone, it looks like I wasn’t standing right in front of the wall when shooting this: the image has some perspective distortion to the right (indicated by the crooked line where the wall meets the grass). For this, we need to use Free Transform (Ctrl+T or go to Edit > Free Transform).

Once it comes up you will see a rectangle and 8 little squares along its sides and corners. Dragging any of those will scale the image (to keep the proportions, either check the chain symbol in the options bar or hold down the Shift key while dragging the corners). To transform the corners freely, you need to hold down Ctrl while dragging – holding down Ctrl+Shift will only let you drag the point horizontally, vertically or in 45° angles.

To correct this images perspective, I dragged the top right corner up a little and the bottom right corner downward (always holding down Ctrl+Shift to keep them “in line”) until the grass-wall line was straight. Then I comitted the change by hitting Return.

On a sidenote: this transformation was a rather small one so it should not affect the quality all that much – technically, I was scaling the image up on the right side, which usually should be avoided.

Straighten crooked images

ex1
Mimmick the crooked line with
the Measure Tool

To straighten a crooked image, you need to find a line within the picture that is supposed to be straight, for example a waterline (like in this example) or something man-made like a window. Locate the Measure Tool measure behind the Eyedropper Tool eyedropper in the Tool bar. Click and drag the tool to mimic the still crooked line (as shown to the left – click and drag with the mouse button held down) .

Then go to Image > Rotate Canvas > Arbitrary. You should see a number different from zero already in the field along with one of the options clockwise (CW) or counter clockwise (CCW) checked depending on the angle and orientation of the line you have just drawn. Don’t change anything, just click ok and Photoshop will do the rest. Usually, Photoshop is right about the clockwise/couterclockwise setting – should it ever rotate the image in the wrong direction, undo the step and hit Rotate Canvas again, just this time check the other option for the direction.

Tip: The same also works with lines that should be vertical (like edges of buildings etc.).

The use of Rotate Canvas leaves you with a bigger canvas then before in order to compensate for the rotation and not cut anything off. The places not covered by the picture itself will be filled with your current background color if you just opened the jpg – to get transparent pixels, you need to unlock the background layer first (see above).

Outro

I hope this was helpful.

Feedback = love

Tags: , , , , ,

2 Comments to Digital Darkroom: Correcting Lense Distortions

Pelleron
November 22, 2008

Very useful. Thank you.

Ana Correal
December 26, 2008

I’ve been living under a rock or something. I just found your Blog, and I’ve had so much fun reading it. It’s perfect and very useful. Thank you so much for sharing your knowldege and opinions with us. It’s all really great. See you around and congrats on your blog.

navigation

Categories

Archives

links

Me Elsewhere

Friendly Faces

Resources

subscription

via RSS feed

rssClick here to sub- scribe to RSS Feed

or via e-mail

Enter your email address below to get a notification each time this blog is updated:

Delivered by FeedBurner