The Wonderful World of Image Stitching
There are a number of reasons why a photographer would want to stitch multiple images together. The most obvious is to create panoramic panels — composites that provide a wide field of view. The second is to produce a digital file that has higher resolution than that produced by a single frame, often of interest when shooting with a low to moderate resolution digital camera.
This technique is equally useful when shooting with 35mm film to create composite frames that are wide enough and large enough to produce extremely large high-quality prints — equivalent to those shot with large format. All it takes is a bit of care when shooting and some work on the computer. Results can be excellent.
In both cases there are a number of specialized software programs available that can automate the task. Some are better than others. My long-time favourite, PowerStitch, is unfortunately no longer available, but there are a number of alternatives, and links to several current products are provided at the end of this article.
Photographed with a Canon D30 and 28~135mm f/3.5L IS lens at ISO 100
This photograph is of the south bank of the Arno River as it runs through Florence, Italy. It was stitched from 3 frames shot at a 35mm focal length. These were overlapped when shooting by about 30%.
One of the reasons why many people prefer to use high-powered stitching programs is because in addition to seamlessly merging multiple abutting frames they also deal with the distortions inherent in combining shots taken at different angles from the same vantage point.
But, many photographers prefer to use the tools that they have at hand rather than purchase yet another expensive image processing program. This tutorial is on how to effectively stitch together multiple images using Photoshop, though it will work with minor modifications in most image processing programs that feature Layers capability. Versions of this technique have appeared in print a number of times, most recently in George Lepp's The Digital Image newsletter.
This tutorial is intended for users of intermediate Photoshop skill. Though I'll do my best to explain each important step I won't explain every keystroke — assuming that you have some familiarity with basic Photoshop operations. Here then is my approach to this technique.
Though there's no need to become too compulsive about it there are a few things to bear in mind when shooting frames for panoramic panels that are going to be stitched together.
Stitching With Photoshop
Photoshop is the Swiss Army knife of image editing programs. It can do almost anything you can imagine. Some tasks are just more difficult or tedious than others. Stitching panoramics isn't terribly difficult, but it can take time and it certainly requires that you understand conceptually what it is that you're doing.
So, let's take this one step at a time.
Like most tasks in Photoshop, being familiar with Photoshop's keyboard shortcuts can make work much easier. If you don't already use them, you should, because they'll make operations much quicker not only for this task but for all of your work.
Step By Step
This will be a lot more interesting if you practice with your own images, so go out and shoot a panoramic set, keeping in mind the do's-and-don'ts that I've listed above. In this tutorial I'll just discuss and illustrate what to do with the first two panels, but everything described also applies to the third, fourth and so on.
Load each of the frames that you'll be working with into Photoshop
Create a new file to hold the stitched panel. File / New. Set the background to White and the file size to the resolution that you want your final print to be. Set the horizontal and vertical size of the file to slightly larger than the combined size off all of the individual frames that you'll be stitching — taking into account that there'll be a lot of overlap. For example, if you have 4 panels, each 6" wide by 12" high, overlapping by 30%, then you'll want to create a new file that's about 16" high by 16" wide. You'll be able to crop it down to only what's needed later on.
Using the Move Tool drag each of the images to the new file. The resolution will be automatically changed to match that of the new file. Each file will become a Layer. If you drag them onto the new file in the correct order (say, if they were shot left to right) then their layers will be automatically named Layer 1, Layer 2, etc. Otherwise give the layers meaningful names, or you'll become awfully confused.
Click on Layer 2, the leftmost layer. Using the Opacity slider on the Layers palette change the opacity to about 50%. Then using the Move Tool drag the image so that something prominent in the middle of the frame is superimposed. In this example I've used the green sign at the top of the tallest building. Magnify the frame so that it's at Actual Pixels and using the Arrow Keys nudge Layer #2 so that this object exactly overlaps.
You'll notice that no matter how careful you were when shooting, even if you leveled the camera, parts of the overlapping frames won't align. (This is the job that the best stitching programs do automatically — resizing and stretching the images so that they do). Don't worry about it though because we'll be dealing with this in a moment.
Select View / Show Rulers and drag a couple of rulers so that they line up with where Layer #1 and Layer #2 overlap at both sides of the frame. This will be useful in a few minutes. Change the opacity of Layer #2 back to 100%
With Layer #2 selected, click on the Add a Mask icon at the bottom of the Layers Palette. Press the D key to set the default foreground and background colors. Next select a paintbrush. It's best to use a brush that has an intermediate edge, so create a New Brush with a Hardness of about 65. You'll be changing the size as needed later using the left and right square bracket keys.
The plan now is to use the medium-soft edged brush that you've created to erase the layer underneath and to select where the transition between the layers is to take place. In this example a good place is in the sky along the edge of the tallest tower.
In Fig-3 I have turned off Layer #1 so that you can see what is being done. Layer #2 is being "erased" under the brush so that Layer #1 shows through. Because I turned #1 off momentarily you can see the white background behind it. The Ruler that was placed where they meet helps show the demarcation point.
Here's the concept. What you are trying to do is to move the sharp edged line where Layer #2 covers Layer #1 beneath it (and which will show the transition) to a place where it won't show, and you're using a soft edge brush to "paint" that edge — blending the layers so that the new transition you're creating takes place in the place that you choose rather than at the straight edge where the frames overlap. Once this new edge is defined you can use a large brush size to remove the rest of the bottom layer and a small brush at high magnification to trace along the edge to refine the transition.
If you now magnify the spot where the two layers meet you'll see that there is no visible join because you've moved the spot where they join to an irregular place where you can blend the transition invisibly. Be aware that if you go past a frame edge and start to show white, you can simply press X to switch from erasing the background layer to erasing the foreground layer.
One thing that can get you into trouble is if you pop out of Layer Mask mode. If so you'll end up painting with Black or with White instead of erasing. Just click on the icon to the left of the layer's title and you'll be back in Mask mode.
Now return to Step #3 above and drag the next panel onto the stitched file and repeat the steps.
I know that this all seems confusing, and this process is likely impossible to learn simply by reading, but if you work with files of your own and follow the steps above I promise that it will be both comprehensible and fairly quick.
Once all the layers are satisfactory aligned you should saved the file, naming it appropriately so that you'll be reminded that it still has all its layers, and that it's unsharpened and uncorrected.
Now proceed to crop, color correct and sharpen the file. My final stitched panoramic is shown as Fig-4 above. You can see a somewhat larger version by clicking on it. It was taken with a Canon D30 and 28-70mm f/2.8L lens set at at 45mm. It is stitched from 7 separate shots. The total time needed to stitch all seven frames using the technique described above was about 30 minutes.
Next to it in Fig-5 is a single frame taken at the same time with the same lens. It was taken at a focal length of 31mm. It's there to illustrate two points. First, it is a 9MB file that can produce a 6" X 9" print at 240 ppi. The stitched frame, Fig-4, is a 22mb file and can produce an 16"-wide print at 240 ppi.
The second thing to note is that the single frames shows keystoning, because I was pointing the lens slightly upward and the zoom was set to a moderate wide-angle. This could be corrected in Photoshop, but the point is that the stitched panel hardly shows keystoning at all because each of its composite frames was taken with a longer focal length.
That's it. As I said at the beginning, this is not a simple procedure, but once you understand conceptually what is being done by the use of a Layer Mask, and practice a bit, it's a very powerful tool. It's also worth noting that this masking technique is the same as is used in my tutorial Blended Exposures, so once mastered offers the user a great deal of image control.
If all of this seems like too much work and bother there are, as mentioned earlier, a number of programs which automate the stitching process. They range from shareware to expensive. Here are some of the ones that I know of. This list is by no means all-inclusive and I have only limited experience with a few of them, so caveat emptor.
|Panorama Tools||PanaVue||Arcsoft Panorama Maker||The Panorama Factory|
If your interest in panoramic photography and stitching is insatiable then you need to visit PanoGuide.com, the best resource on the web related to panoramic imaging.
Finally, this technique will be featured in a live hands-on tutorial in a forthcoming issue of The Video Journal.