A Request From A Reader

Steve---------How about discussing the ins and outs (pun intended) of wide angle lenses tendency to distort vertical lines.  Example in this weeks article would be KVWs nice shots of the church in Holland and the very noticeable cant inward, yes, I realize the camera is pointed upward.  The shots taken in the front/living room show none of the typical "bending" I see in some interior shots.  Lenses or technique.  Answer back if this is too simplistic to discuss in the column.  Thanx,  Car le


Car Le -

Properly explaining this is well beyond the scope of a "Readers Question" so I thought I'd turn it into a learning topic and answer it more completely than I would have otherwise.  This is a common question, yet it's in the realm of "advanced techniques" in Photoshop so I'll try and keep it as simple, yet meaningful, as possible.



The images in question are a nice shot of a church in Norway by a frequent contributor KVW.


The images in question are a nice shot of a church in Norway by a frequent contributor KVW.

KVW's Church Shot from Norway


You can see several types of distortion in this image, even though it's not shot at a very wide angle.  I'm guessing under 30mm equivalent.  KVW shoots with a Canon 40D and a 17-85mm IS lens and this is probably at the wider end of that lens.  Since it's a APS-C sensor camera, the 17mm is a 27.2mm equivalent.


The next images were some I shot of my living room after a recent remodeling.


Condo in the sky

Canon 1ds Mark II, Sigma 12-24mm @12mm  F11 15secs  ISO 100


Freshly renovated

Canon 1ds Mark II, Sigma 12-24mm @12mm  F11 5.6secs  ISO 100


Both of these images were shot with a full frame 12mm rectangular lens.  Distortion is always more obvious the more wide you go.  12mm's leaves open the possibility for a great amount of distortion so careful setup during the capture process is mandatory.  Both of these images exhibit minimal distortion, less than came from the camera.  Both images required software manipulation to correct for both lens and perspective distortion.


Types of distortion

There are two main types of distortion photographers have to deal with.

    1. Lens Distortion
    2. Perspective Distortion


Lens Distortion

Lens distortion comes in two types.

    1. Pincushioning Distortion
    2. Barrel Distortion


Typical bar patron in Nana Plaza

Canon 1ds Mark II, 85mm F1.2  F2, 1/80th  ISO 3200


We'll use the image above to induce distortion for the purpose of examples.


Barrel Distortion


Barrel distortion example

Graphic Representation of Barrel Distortion


Barrel distortion is most commonly associated with wide angle lenses.  The more wide, the more pronounced will be the distortion.  Barrel distortion is represented in the image above by an image the protrudes towards you, gently bending the outer edges outwards as you'd see it on a screen or print.  It's important to understand that the image is 3 dimensional, that its coming out towards you as if someone is pushing the back of the print out towards you.  If there was a subject in the image it would appear distorted much the same was as the image below


Extreme barrel distortion

Canon 1ds Mark II, 85mm F1.2  F2, 1/80th  ISO 3200


The image above has greatly exaggerated barrel distortion, almost a fisheye effect.  Notice how the edges of the subject unnaturally bend outwards and the center of the image comes out towards you?


Correcting barrel distortion in Photoshop

Photoshop CS4 Transform Module, Warp Function


This is a graphical representation in Photoshop CS4 showing how you can use the Transform Warp function to hand correct for barrel distortion.  Notice how I used the image above, brought the outer edges inwards, and how the lines going through the center represent pushing the center back inwards as the out part of the frame corrects?  This can be very hard to visualize so stick with me.  It also helps if you follow along in Photoshop and make these corrections yourself, while watching the changes happen in real time.


Pincushion Distortion


Pincushion Example

Graphic Representation of Pincushion Distortion


Pincushion distortion is most often associated with telephoto lenses.  The image above represents pincushion distortion and it's much the opposite of barrel distortion.  The edges of the subject pull in towards the center, and if you could see the third dimension it would be protruding from the center of the image AWAY from you, as if you were pushing the print in the center away from you.


Pincushion effect

Canon 1ds Mark II, 85mm F1.2  F2, 1/80th  ISO 3200


Again, the example image above is greatly exaggerated so you can easily see the outer edges bend inwards and the center of the frame push inwards.


Correcting pincushion distortion in Photoshop

Photoshop CS4 Transform Module, Warp Function


And again, using the Transform Warp function we can pull the outer edges of the frame outwards which prompts the center of the frame to move out towards you as represented by the lines.  Open up Photoshop and play with this and watch the image distort as you move the controls.

I should also mention that correcting for any sort of distortion is almost an art, and not a "click to happen" function.  You need to gain experience with your eyes so you can tell what you're seeing, and experience with many images so you can get used to gently manipulating the controls to move the image back into shape.


Photoshop Workflow, Correcting Lens and Perspective Distortion

There are several ways to correct for lens distortion.  Barrel and Pincushion distortion can be corrected using the Photoshop tool, PTlens  (my personal favorite, a review to follow in the coming weeks), and some raw processing software will have this capability.  A few weeks back we reviewed Helicon Filter , which was a complete software geared towards entry level to intermediate photographers that did everything you'd want to do to an image, and included very easy to use distortion correction features.

Today we're going to demonstrate the use of the lens correction tool in Photoshop.  In CS3/4 select Filters/Distort/Lens Correction.  Once in the lens correction module you'll be able to make corrections ranging from distortion, to Chromatic Aberration, to Vignetting.  We're only going to discuss the distortion controls today.

Basically you need to know where the distortion controls are, and what they do to an image.  Below, are individual frames from inside the Lens Correction module showing an example of each type of image manipulation possible.  A red star will be centered over the control used, and a blue title will tell you what kind of distortion is being induced.  Of course you should release we don't want to induce distortion, we want to decrease it.  So while a control will induce a certain type of distortion to a non-distorted image, know that the same control will have the opposite effect on a distorted image.  For instance to reduce barrel distortion, slide the "Remove Distortion" slider to the right.  Again, it will be very helpful if you can follow along in Photoshop.


Examples of distortion

Examples from Photoshop CS4 Lens Correction Module


In the image above you were able to clearly see how the controls of the Lens Correction module manipulated distortion.  Now we'll use these controls in concert with the Transform Warp functions to correct some sample images.


Example 1


Sanctuary of Truth Pattaya

Canon 1ds Mark II, Sigma 20mm F1.8  @F11


Lets discuss this image.  Most people are going to look at it and not see any distortion, at least not anything objectionable.  After all, this entire structure is an exercise in distortion.  However, if we look closely we can see that the small adjoining structure on the left (with the orange colored faces) is leaning towards the center of the frame, and the entire structure appears to be leaning back some.  Also, if you look along the bottom of the structure, along the baseline, you can see it's not level.

This image was captured with a 20mm lens on a full frame DSLR, so it's an actual 20mm.  This is great for getting a lot into the frame, especially when standing fairly close to the subject (30 feet away from a structure hundreds of feet in width).  A very common problem with architectural photography is that the photographer is almost always stuck on the ground level shooting upwards.  This creates all sorts of inherent distortion issues with the image, and while we can correct them to a degree with software, it's much better to capture them correctly in the first place by using the proper lens and being on the proper plane.  How?

I know the man who was the main photographer for the new international airport and I remember discussing this issue.  As you know the airport has many large and tall structures and simply standing in front of them with your camera on a tripod isn't the professional way to make these captures without distortion.  What did he do?  He had a 40 meter lift modified to go every higher, and many of his captures were made while on this lift suspended far into the air.  To do this took a great amount of coordination and resources, but as a professional photographer you put these details and requirements into your bid and hope the person approving the bid understands photography.

Since as tourists and hobbyists we can't tow around a 40+ meter lift to photograph temples and other structures we have to make do.  We often can't get far enough away from the subject to use a normal perspective lens (60-100mm would be appropriate for this subject), and even if we could get that far way we might then have to deal with haze, people, and other issues that affect the image.  So, we have our wide angle lenses, a tripod, and we stand in front of the structure and capture an image like.  Later we correct it in Photoshop like we're going to do now.


Correcting distortion in Photoshop

Photoshop CS4 Lens Correction Module


In the image above we're in the Lens Correction module in Photoshop CS4.  Filters/Distortion/Lens Correction.  Using the "keyhole" perspective control we've "tilted forward" the structure.  The top of the structure is now closer to us, and the bottom further away.


Keyhole corretion

Photoshop CS4 Lens Correction Module


Above you can see how we now use the pincushion/barrel slider to induce a pincushioning effect thereby sharply reducing the barrel distortion common with wide angle lenses.


Pincushioning correction

Photoshop CS4, Transform Warp function


In the above image we've finished with the Lens Correction module and we're now in "Free Transform" in the Warp module.  We've pulled the bottom of the image straight reducing the look of pincushioning, pulled out the sides a bit to correct the inward tilt, and straightened the very top part of the structure.  There is no 'right' way of doing this, no set workflow to follow.  You look at it, decide how you want it to look, and then use the controls to achieve that effect and you usually end up balancing other aspects of the image as you adjust another. 


Sanctuary of Truth Pattaya corrected

Canon 1ds Mark II, Sigma 20mm F1.8  @F11  Corrected


And here is the finished image.  What, you can't see any difference?  Subtle differences are often hard to see without a side by side comparison..


SOT Before and After



In this side by side comparison you can more easily see the corrections.  The top of the structure is definitely more towards you, and the bottom further away.  The small structure with orange faces on the left is not leaning in as much as before.  In today's blog entry we discuss the adage "the enemy of good is better" and this would apply here.  Don't over do your corrections.  Often you'll need to make small changes, look at it for a while, and then decide if you want to go further.


Example 2


Example of carvings

Canon 1ds Mark II, Sigma 20mm F1.8 @F11


This is a more extreme example which you should be able to see easier.  Notice how strongly the top of the image leans away?  How the edges barrel outwards?  I was right on top of this image, just 10 feet or so away from the structure with a 20mm lens.  Distortion was unavoidable.


Correcting carvings in Photoshop

Photoshop CS4 Lens Correction Module


We bring it into Photoshop's Lens Correction module.  Filters/Distort/Lens Correction.  Immediately we use the keyhole perspective correction slider to tilt the top of the structure towards us.  We can't make it perfect because the shooting position was just way to close, but we can make it better.


Distortion Correction Photoshop

Photoshop CS4 Lens Correction Module


Next we reduce some but not all of the barrel distortion by using the pincushion/barrel slider.  Again, we can't remove it all because this is an extreme example, but we remove a lot of it.


Correcting distortion Photoshop

Photoshop CS4, Transform Warp function


Now we bring it into Photoshop's Free Transform tool and select the "Warp" function.  Ever so carefully we straighten out the bottom, bring the sides down some, and align the top of the image.  This is a matter of degrees.. and again it is not possible to make full corrections.  We're merely trying to make it look good.  Good is often preferred over "better" if better causes more issues and upsets the balance.


Finished example

Canon 1ds Mark II, Sigma 20mm F1.8 @F11  Corrected


And above we have the finished image.  Can you see the differences?  You should be able to, but if not look below.


Distortion, before and after



Side by side comparisons reveal profound differences.  Which do you like better?  I think there's little doubt the "after" image looks more natural and less distorted. 


Example 3

Lets go back to KVW's church shot which prompted the question on wide angle induced distortion.  It's a small 600 pixel image but we'll work with it anyway.


Distorted church

KVW's Church Shot from Norway


Notice the outer tower leaning in?  How about the heavy barrel distortion?  The left side of the building not straight up/down?


correction in Photoshop

Photoshop CS4 Lens Correction Module


We bring it into Photoshop's Lens Correction Module.  Filters/Distortion/Lens Correction.  Immediately we remove some of the keyhole distortion and a bit of the barrel distortion.


Correction in Photoshop

Photoshop CS4, Transform Warp function


Now we bring it into Photoshop CS4's Free Transform module and select the "Warp" function.  We bring pull at the upper side a bit and straighten the tower, and then we do what we can on the left side.  Because of the tree and different planes we can't do much, but we can do a little.


Church corrected



How about that?  Not perfect, but a lot better.  We might have brought the tower over too far.  Perhaps we did.

These examples illustrate how to make the corrections you'll require most often.  The same controls and techniques can be used to make any type of distortion correction(s).  I could have covered every type of distortion and made example images to follow.. but it would have ended up being a book more than an article.

You now have some very good knowledge and techniques to employ during your processing phase.  Give them a try and if you're happy with any of them, or have questions, send them in and I'll post them in this column.