Focus Stacking for increased DOF

Started by sshire · 11 replies · 3,298 views

sshire
3 Jul 2015, 21:58
Focus Stacking

A method to seamlessly combine the multiple images with varying planes of focus into a single, in-focus image.

Let me preface this with a disclaimer. I have no idea how to accomplish this in anything other than Photoshop (CS4 and later.) Not Photoshop Elements, not Preview or any other piece of software.
I’m quite sure that there are other software packages that can do this. Or not.
I’ve used Photoshop almost exclusively since



Here are the images. I started with the focus on the front.



Then, progressively moved focus to the rear.










Note this convention: > means next menu level down

First, File>Scripts>Load Files into Stack (so, open the File Menu, then select Scripts, then select Load Files into Stack. This will take the selected files and put them into separate layers in the same file.



Once the images have ben loaded into layers, select all of them.



Then Edit>Auto-Align Layers



This will align the images if you kicked the tripod.

Next Edit>Auto-Blend Layers and MAGIC!



The image processing algorithm compares edge diffusion and contrast (the sharper parts of the image have less diffusion and greater contrast), then, creates alpha channel masks to only show the sharp segments. The mask edges are then tweaked to seamlessly blend the images. There is a lot of math going on here.

The entire processing time was 7.4 seconds. (MacBook Pro, 3.1 gHz, 16GB RAM)







sshire
Reply #1 · 3 Jul 2015, 22:05
After I posted, I realized that I forgot to stack the rearmost image (focus on the generator). Sorry, but you get the concept.
b.lindsey
Reply #2 · 3 Jul 2015, 23:17
That is amazing Stan. The result is certainly better than the original picture. I am assuming it is necessary to use a tripod or similar to make sire each picture (aside from the focal length) is in the same place in the frame.

Bill
sshire
Reply #3 · 3 Jul 2015, 23:33
Not necessary. As long as you're close, Photoshop will find identical elements and auto-align the images
Don1966
Reply #5 · 4 Jul 2015, 00:13
Stan my wife was talking about this to me last night. She is into photography and has a Nikon high price camera with a bunch of lens. I have Corel photoshop but not sure if I can do that in it. I need to check to see if I can. If not I will need photoshop. Thanks for post this buddy.

Don
spuddevans
Reply #8 · 4 Jul 2015, 07:07
I've used this technique with extreme macro photography, see below for a sample of a rusty head of a slot headed screw.

There are several free or open-source software solutions, the one I've used is CombineZP http://www.hadleyweb.pwp.blueyonder.co.uk/



As I recall that one is made up of 14-17 frames

Tim
dvbydt
Reply #10 · 5 Jul 2015, 15:39
That is almost too good to be true. No more 22seconds at f32.

Ian
sshire
Reply #11 · 5 Jul 2015, 16:05
Also, the longer the exposure with a digital camera, the higher the signal to noise ratio

Quick reply

Log in to reply.