To contents page

Panorama Stitching

Panoramas made up by stitching digital images take some practice and effort to pull off successfully. However they reward perseverance and offer a way of producing large high resolution images using simple equipment. Many panorama images on this site were taken with a simple 'point and shoot' camera, yet yield beautiful A3 sized prints on an Epson 1290. 

First of all, take all the shots with the exposure locked - you will have to decide whether to pan right or left depending on how you judge that will effect the exposure (or take an average from an important feature within the image). Watch out for vignetting by lens hoods or filters that can cause darkening in the corners of images. This is particularly important for images with clear blue skies, but you will probably only see it when you come to overlap images and the darker top corner of one image has to be blended with the lighter middle of an adjacent image. Also take care if you are using a polariser, the effect of the filter is related to the angle of the camera to the sun, so sky intensity can vary considerably across a wide panorama. If there is light fall off towards the edge of images this can be coped with by cropping off the edges of images prior to blending.

Overlap the images by 20-30% - more won't hurt, you'll just end up with a smaller panorama. If you are using a digital camera it may have a panorama or stitch mode that makes the process easier by displaying sequential images in the LCD. Many of the panoramas shown on this site were taken hand holding the camera and lining up the images in the LCD. If you are using a film camera or a digital SLR either use a tripod for panning between shots, or pick a distinctive feature close to the edge of the frame and use that to line up the next shot. 

Open all the images in Photoshop and then create a new blank image with a white background. Make the new image large enough (in pixels) to be bigger than the images placed edge to edge and also larger in height, this will allow you to slide the images around to line them up.

Click on each image in turn and then click and drag from the layer palette into the new image. Each image will then be on a separate layer in the new image. Double click on each layer within the palette and give each layer a  name - it saves a lot of time later on by preventing you selecting and moving the wrong layer by mistake and undoing your careful alignments. The picture below shows two images after dragging into the new image as separate layers and renamed left and right.

 

Experiment with the layer order of the images within the panorama, this allows you to see roughly where the joins will be and choose where the joins will fall. Joints at any position can be dealt with given practice, but it makes things easier to choose areas without obvious horizontal features if possible.

Once you've decided on the layer order you can start to line up the images. Start on one side of the image, select the layer that is in front, and then reduce the opacity of this layer to around 50% to let you see the layer behind. Now select the back layer and slide it around until the two images line up. The degree of matching between the two images will depend on a lot of factors including the focal length of the lens used, and whether a tripod was used. Don't worry if the two images will not overlap exactly, just try to get obvious features, the skyline or horizon, water edges etc. to line up. If required Photoshop offers many ways to transform a layer by stretching, skewing or changing perspective, all of which can be used to match images - but this takes trial and error.

There may still be problems in getting images to line up with reasonably seamless joints at this stage. This may be due to intensity differences in the sky caused by light fall off at the edge of the lens, or to features at the edge of the image that are distorted relative to the same feature in the adjacent frame. If this is the case, make a rectangular selection at the edge of one of the affected images and delete this portion, this will shift the blend position sideways away from the affected area. Continue the matching process until all images are lined up and restore all layers to full opacity.

Now is a good time to crop the image to remove the unwanted areas of white background around the panorama, just crop so that there are no raw edges, cropping to finalise the image composition should be left till you are finished the whole process.

Now use whatever is your favoured method to balance the images for any minor exposure differences. Minor adjustments using levels should be OK - I usually just try to ensure that the sky has the same brightness between the different images - differences in flat areas of colour like sky, water, snow etc are most likely to show up when the images are blended. You may have to take a decision on where in the image to match the brightness, this will be the case if there is any gradation of brightness across the sky, either due to nature or to lens vignetting as described above. Minor differences can be accommodated in the blending process described below, but it takes practice. In the example below a levels adjustment layer has been used to slightly darken the left layer to match the sky brightness on the right.

The next step involves the use of layer masks. Select the layer which is on top of the stack, and create a layer mask (click on the left button at the bottom of the layer palette, circled in red). A layer mask thumbnail will appears next to layer thumbnail in the layers palette (circled in green). Now click on the brush (blue circle) within the tools palette and select a fairly large soft edge brush, say 50-100 pixels. Make sure black is the foreground colour (switching to layer mask mode automatically selects black and white as the default colours). Now paint on the image in the area of the overlap between the top layer and the layer beneath. As you paint you'll see the layer underneath show through and the images begin to blend together. The area you have blended appears in black in the mask thumbnail. If you overdo the blend simply switch to painting with white which will reverse the effect. Continue until you have achieved an invisible blend. (If you like you can reduce the opacity of the brush to fine tune the blend to any degree you want.) Zoom the image in and out as you go along to check on the progress of blending. I usually work at quite a high magnification and hold down the space bar to switch the brush to the hand tool so I can move around without zooming out

Repeat this process for each join in the panorama.

Once you're happy flatten the image down onto one layer, crop to the final composition, and then make final changes using adjustment layers, unsharp masking etc. as for a standard image.

On a final note, if your image contains buildings or other elements which have straight lines which are not vertical or horizontal you will probably find that the procedure described above will not yield an invisible blend between the images in the composite. In this case you will need to remedy any distortions by editing the flattened image. It is impossible to give detailed instructions on how to achieve this here as the procedure will be different for every image. Judicious use of the cloning tool or local transformations on selected areas should do the trick. This was used to make the blends in the panorama of Penarth Pier on this site, where variations in the perspective of the pier decking made blending very difficult.

Update - Automating Panoramas

I've written Photoshop actions to automate the first part of the panorama stitching process; assembling images onto a new canvas and creating layer masks. You can download these actions from the Automating Panoramas page

Technical index