Focus Stacking – Photoshop Elements 13
A PDF version of this tutorial is here: Focus Stacking – Photoshop Elements 13
What and Why?
This is a “Sister” document to a similar one on Photoshop CC 2015 – The clue is in the title. Photoshop Elements is a bit more of a challenge, but can be done and is worth the effort if that is your editor of choice. First the part that is the same for either editor:
If you have done any Macro Photography, you will have come up against the problem of very shallow depth of field. So for example on a flower, the stamen may be sharp, but the rest of the flower out of focus. Sometimes that is used to advantage, but at other times you would want to see fine detail in the rest of the plant.
Focus stacking is a way of doing that. It is achieved by taking a series of photographs, focussed further and further into the subject and then processing them all to produce a single picture which only shows the parts of the various images which are in focus. It does that by using layers and layer masks, as described in this tutorial.
However you are going to process the photographs, the initial stages are the same – getting a range of images, each with a part in focus.
Start with a tripod, giving as firm a base as possible, a camera and macro lens, a remote release and a steady hand. If you do not have a remote release, then a 2 second delay will give the camera time to steady before shooting. If the final images are still not perfect then SLR users may wish to use mirror lock-up. Image stabilisation, if available, should be switched off on the lens whilst on a tripod.
Each image needs to look identical in terms of positioning, light and contrast, so the camera should be on manual focus, iso=200, with f/stop and exposure also set manually. f/stop should be a high number, to give as much depth of field as possible, though probably not on its limits, where lenses tend to be softer. Time to experiment!
Focus on the nearest part of the image, take the shot and then focus further into the image, taking that and so on until you have as much of it as you wish. You will now have several images – identical, except for the point of focus.
Layers and Masks
The final image will be created by making each image a layer in one final image. That is achieved differently for Photoshop CC and Photoshop Elements, which is described below. Photoshop CC 2015 is covered in a separate sheet.
In either case, a mask is attached to each layer (image). When first created, a mask is White, so the main picture shows just the top layer. If any part of the mask is Black, then that part of the associated layer is transparent, and the layer below becomes visible. So if only the in-focus part of the top layer is painted White on the associated mask, then the rest of the image below is visible. If the next layer is selected and the associated mask painted black in the out of focus areas, then the next layer becomes visible and so on down the stack.
In the end, only in-focus areas are visible, plus any out of focus areas in the bottom layer which haven’t been included in the layers above.
It is as easy as that 😀. (You may want to read that again, or follow through the detailed instructions, when it will become clearer).
Photoshop Elements 13
Photoshop Elements does not have the advantage of a script to make all the images into layers and a facility to create the mask, exposing only in-focus areas of all the images. So we have to do it manually. The workflow is:
- Rename Files as taken to image_1.jpg to image_x.jpg where x is the number of images. The name can be whatever you want, but the index number (1 to x) is useful, so that 1 is the nearest to the lens as taken and x is farthest away. The nearest to the lens should be at the top of the folder, and so at the top of the stack.
- Start Photoshop Elements – Advanced mode.
- Make sure the layers panel is visible. If not, select it from the Window Menu. It should look similar to this (This is on a Mac – Windows versions may look slightly different).
- Open all the images which you are going to use (Navigate to folder, click on image_1.jpg to highlight it. Hold down the shift key and click on image_x.jpg, to select them all. Then click on “Open”).
- Select the next to last image – We do that because as we add layers, they are put onto the top of the stack and we want image_1 to be the top. It saves rearranging them later. So image_x.jpg will be the one to which we add new layers. So with the next to last image selected:
- Press Ctrl A (Windows) or Cmd A (Mac) to select whole image. From here on Ctrl/Cmd A etc will be the shortcut
- Ctrl/Cmd C to copy it
- Click on image_x.jpg – The final image in your sequence
- Ctrl/Cmd V will insert image_2 as a new layer in image_1. It will name it Layer 1, the bottom being “Background”
- To avoid confusion, if not too late, I would unlock the Background layer by clicking on the padlock to the side of it. It will become “Layer 0”. I would then rename it image_x where x= the number of images you are including. I have 7 images of balls in a line, so the background becomes image 7, the next image 6, and so on. It doesn’t have to be “image” it could as easily be “ball 7” “ball 6”, etc. Do you ever find that trying to make something simpler makes it more difficult? Me too 🙂 Edit text by double clicking on it.
- Close the image you copied FROM. (image_6 in my example)
- Click on image_5 in my example – The next one.
- Repeat the process – Ctrl/Cmd A; Ctrl/Cmd C to copy it; Click on image_7 (The final one); Ctrl/Cmd V to add the new layer. It will add as “Layer 1”.
- Click on the thumbnail image and drag the layer to the top of the stack if necessary. Layers are added to the layer above the one selected, so this step won’t be required if the top layer was selected
- Rename the layer image 5
- Close the image you copied FROM. (image_5 in my example)
- Repeat for all the images, closing the FROM images as you go.
- Save image with a new name as a psd or tif file. This will preserve the layers you have just built – jpg files do not have multiple layers.
- Create Masks
- Select image 1 layer.
- Identify the “In Focus” areas of the image and use selection tools to select them (Lasso, Elliptical, etc). Remember that you can add several different selections to a layer by holding down the shift key, though if you try to move one, they all move. Selections can be altered – right click on selection and choose “Transform Selection”.
- Click on “Add Layer Mask” – The icon that looks like a tumble drier on a clothing label. (As square with a circle in it for non-laundry-literate). A layer mask should be added (Yes, I know, but it had to be said).
- The mask will be created with white where the selection was and black everywhere else.
- Select image 2
- Repeat the above for the layer
- Move down the layers, selecting and creating masks. Don’t worry if you select an area that has already been selected – The mask above will have done it’s job and this one will be ignored.
- Do not add a mask to the bottom layer or there will be nothing except the bits you selected as masks. If I didn’t tell you in time (sorry) right click on the mask and delete it (Delete layer mask). The reset of the picture will reappear.
- If it doesn’t look right, you may wish to put the mask back on image 7. Then right click on image 1 and select “Duplicate layer”. Name it Layer 0. Right click on it a delete the mask, then drag it to the bottom of the stack. That layer, which has the nearest bits in focus, will now act as the backdrop to the rest of the image.
- Remember that Masks can be edited – White to show what is on the layer, black to show the layers below. To do that, select the layer, then click once on the mask. Paint Black or White on the picture, which will update the mask.
- Select image 1 layer.
- Save image as jpg. Also saving as tif will keep the layers for later changes, but the images are huge.
You should have an image which incorporates all of the in-focus parts of the images.
Photoshop CC is more “automatic” and is included in a separate sheet.