# Focus Stacking



## ray5 (Mar 13, 2015)

Hi,
I am trying to understand and use this technique. I did a google search and there are a ton of stuff. Is there a good video tutorial on the actual technique? A tutorial on the actual step by step technique for the stupid folks like me and also the processing. Also perhaps an article/s on it's philosophy, challenges and advantages? I stumbled upon it for doing cityscapes and landscapes when I wasn't happy with the sharpness of the entire field. Thanks,
Ray


----------



## YuengLinger (Mar 13, 2015)

http://www.cambridgeincolour.com/forums/thread32044.htm

First result on Google. : Lots more too!

PS CS6 works fine.

Have fun!


----------



## YuengLinger (Mar 13, 2015)

And here's avid covering basics.

http://www.youtube.com/watch?v=yqAXR94X0T8


----------



## AcutancePhotography (Mar 13, 2015)

If you use Light Room, there is a plug in called Enfuse that works great for both focus stacking and exposure stacking.


----------



## Zeidora (Mar 13, 2015)

For scenics/landscape at optimum f-stop for sharpness (usually 2 down from fully open), that is relatively few frames (maybe up to 10), particularly with WA. Generally, you want to have a bit of DOF overlap between shots, so steps between shots are 70% of DOF. I hope your lens had DOF markings on the barrel. You may get away with PS stacking, though for 100 frames in macro PS is useless. For macro, ZereneStacker and HeliconFocus work great. I am unaware of any way of automating the focus change, but there may be some ways of doing it. Lens focus information is available, so it should be possible to instruct camera to successively change focus by a certain increment, call it focus-bracketing.
I do mainly macro, and there you move the camera. With the Cognysis Stackshot, that can be automated. I regularly do >100 frames with 50 µm focus increments.

Second, not sure stacking will solve your sharpness issue over entire field. It could also be that the lens is getting soft towards edge. No amount of stacking will solve that, then you are better off getting a better corrected lens. The way to test your lens, shoot a scene at various focus settings, then check whether at least in one frame, the peripheral areas are sharp. If sharp, then stacking can help, if not, it's the lens.

Stacking will reduce sharpness by a hair. The trade off is in favor of stacking, but you will loose a bit during the process.


----------



## tolusina (Mar 13, 2015)

Zeidora said:


> .... I am unaware of any way of automating the focus change, but there may be some ways of doing it. Lens focus information is available, so it should be possible to instruct camera to successively change focus by a certain increment, call it focus-bracketing......


Tethered to an android device, stack shooting is a breeze using DSLRController.
Helicon Remote can too, tethered to a PC, MAC or Android.
After using DSLRController on my phone, I liked it so much that I bought a tablet primarily to use with that app and my 6D. There is an annoying but workable latency over WiFi, cabled tethering over USB is pretty close to real time.

Both of these solutions control lens focus. 
Some prefer using a micro adjustable macro rail (manual or rather expensive motorized and automated) to the shift the camera and lens as a unit.

At macro distances, apparent focal length shifting comes into play when shifting lens focus, I expect the same effect when using a rail. 
At macro distances it's mostly a non-issue as stacking in software effectively corrects the subject, out of focus fore and background objects do exhibit jittery bokeh. Use of a plain background eliminates the bokeh issue.
You've given me an interest in trying at landscape distances, mostly to see if focus shift is still an issue.

If I was determined to manually and physically control focus shifts, I'd for sure want a rail. 
I'm delighted to let computer power control the process, I still get to determine the steps.


----------



## mackguyver (Mar 13, 2015)

I think the OP is talking about focus stacking for sharpness & DOF, not macro. I.e. taking several frames at the lens's optimal aperture (f/5.6) at different focus settings and stacking them for optimal sharpness and DOF. This is a different technique and doesn't require rails or anything else. The only snag is with varifocal lenses (most Canon AF lenses) as the focus breathing will reduce the field of view. This is particularly annoying on the 70-200 f/2.8 II, and this technique works best on parfocal lenses where the FOV stays the same during focus adjustments.

Here's a good tutorial on it:
http://digital-photography-school.com/getting-landscapes-sharp-focus-stacking/

I have tried it several times and haven't found it worth the effort over shooting at f/16, but YMMV depending on the subject and it never hurts to give it a try.


----------



## Zeidora (Mar 13, 2015)

tolusina said:


> Tethered to an android device, stack shooting is a breeze using DSLRController.
> Helicon Remote can too, tethered to a PC, MAC or Android.



Had a quick look at the DSLR controller. It seems that the focus step sizes are fixed, presumably for each lens slightly different? As DOF changes with f-stop, you should be able to adjust step-size depending on which f-stop you set. Is that possible?
Second, how accurate is the distance indication? I notice on the Canon AF lenses, they focus into hyper-infinity, so the end point of the focus adjustment is not infinity, so one fix point is already quite a bit off. It seems that focus range is defined as point A and point B (as opposed from infinity to 3 m), so far so good. But it adds the problem that step calculation for given f-stop is impossible, unless you manually enter the real distances for point A and point B.

Excess steps don't hurt in my experience. Did a series from 0.1 to 1 DOF in 0.1 increments (then also 1.4 and 2) and I could not see differences up to full DOF step increments. It just takes longer to process (200 vs. 20 shots). At >1 DOF you do see softness in certain detail areas.

I only know Stackshot, and there I set up an excel table to calculate DOF at various magnifications (from 1:10 - 7:1) and f-stops (omitting smaller f/stops for higher mag macro because of diffraction). Stackshot does not know the lens or f-stop setting. 

Re difference of stack vs. small f-stop, there is a difference in the transition area from sharp to out of focus. With stacked shots, there is a sharp separation, with small f-stop, it is gradual. That can be an interesting visual communication tool. At f/16 on crop sensors or with small pixels, blowing up to 8x10, you get close to the diffraction limited area. On full-frame <~20MP or for web display, you should be fine.


----------



## ray5 (Mar 13, 2015)

Thanks all for the links. I had already reviewed some of them.
I saw two tutorials on Youtube.
-One did a macro stack: Where the person changed the focus points and took shots in Auto.
https://www.youtube.com/watch?v=qAXDV-NMoMc

- Second did a landscape in Manual and used the markings on the lens barrel for focussing. But at least in the video did not fine tune the focus using the focus ring.
https://www.youtube.com/watch?v=yqAXR94X0T8

Any major difference in the final product? Is there a preferred technique for landscapes? Or is it just different techniques, one is Auto and the other manual? In the manual mode why didn't he fine tune the focus? Perhaps he was just demonstrating the technique and not really every step?


----------



## YuengLinger (Mar 13, 2015)

Now, ray, should't we be applying what we've been learning? Then post a few here.

Focus stacking makes plenty of sense after doinf a bunch of times.

Sorry, it's the teacher in me.


----------



## GaryJ (Mar 13, 2015)

For landscapes I shoot through the scene front to back,focusing on different points , making sure to overlap the sharp areas,this takes as many shots as needed,then using layers in Ps I process to blend them ,sorry not so good at explaining but if you are au fait with layers you will understand.Macro Rail and Zerene Stacker for my macro work,Iknow OP was after landscapes,this is just for explanation.


----------



## ray5 (Mar 13, 2015)

YuengLinger said:


> Now, ray, should't we be applying what we've been learning? Then post a few here.
> 
> Focus stacking makes plenty of sense after doinf a bunch of times.
> 
> Sorry, it's the teacher in me.



But But Teacher, I am not ready yet!!
Sorry, the ever facetious student in me!! 

You are probably correct, nothing like going out and shooting and learning. But where I am have nothing but barren corn fields right now. Hope to theoretically get it before venturing out soon. Thanks for the links though.
Ray


----------



## ray5 (Mar 13, 2015)

GaryJ said:


> For landscapes I shoot through the scene front to back,focusing on different points , making sure to overlap the sharp areas,this takes as many shots as needed,then using layers in Ps I process to blend them ,sorry not so good at explaining but if you are au fait with layers you will understand.Macro Rail and Zerene Stacker for my macro work,Iknow OP was after landscapes,this is just for explanation.


Hi,
I assume your technique involves moving the focus point and have them overlap a bit( bit like pano. except overlap the focus point and not the frame itself?) and then blend?


----------



## ray5 (Mar 13, 2015)

mackguyver said:


> I think the OP is talking about focus stacking for sharpness & DOF, not macro. I.e. taking several frames at the lens's optimal aperture (f/5.6) at different focus settings and stacking them for optimal sharpness and DOF. This is a different technique and doesn't require rails or anything else. The only snag is with varifocal lenses (most Canon AF lenses) as the focus breathing will reduce the field of view. This is particularly annoying on the 70-200 f/2.8 II, and this technique works best on parfocal lenses where the FOV stays the same during focus adjustments.
> 
> Here's a good tutorial on it:
> http://digital-photography-school.com/getting-landscapes-sharp-focus-stacking/
> ...



What did you mean by focus settings? For this I assume the camera is on a tripod, the composition remains the same, so does the aperture, shutter speed and ISO. Thx for the link, that's one of the first articles I had read.
Ray


----------



## chauncey (Mar 14, 2015)

I do tons of it using my tripod mounted 180mm macro lens mounted on a 1Ds3.

I shoot tethered using Canon Utility Software which allows total camera control from your Windows OS computer. 
Is a simple matter to chose your camera settings, focusing point, taking the shot>changing the focus point>
take the shot>again and again, until you have captured the entire focus range desired.

Import the series into LR to make initial adjustments the open as layers in PS CC>auto align>photostack.
None of the other software is as trouble free as PS CC...IMHO


----------



## quod (Mar 14, 2015)

The articles/videos posted already provide a good background on focus stacking. Here is yet another article:
http://www.stevemackayphotography.com/section363141_130929.html

Even though I enjoy Gavin Hoey's tutorials, in the video posted by YuengLinger, he shoots at f/22, which I do not recommend because diffraction will kill some of the sharpness that you are seeking to get from focus stacking. I suggest setting your aperture to f/8 to f/11 (or f/16, at most).

Due to focus breathing by your lens, your stacked shots may be a little fuzzy on the edges of your entire photo (at least, this will occur if you process in Photoshop). My suggestion is to shoot a little wider than you would normally shoot in order to provide yourself a little cropping room on the left, right, top, and bottom. I blew a tightly framed focus stacked shot once because I did not account for the fuzziness on the edges.

I also recommend making manual camera settings, a set white balance (no AWB), and manually focus (with AF turned off). By doing this, you won't have variation in white balance or exposure, and you can control focus.

Lastly, I suggest shooting via mirror lock up, or via LiveView with a 2-sec timer or with a remote timer, in order to minimize vibrations from mirror slap.


----------



## YuengLinger (Mar 14, 2015)

quod said:


> The articles/videos posted already provide a good background on focus stacking. Here is yet another article:
> http://www.stevemackayphotography.com/section363141_130929.html
> 
> Even though I enjoy Gavin Hoey's tutorials, in the video posted by YuengLinger, he shoots at f/22, which I do not recommend because diffraction will kill some of the sharpness that you are seeking to get from focus stacking. I suggest setting your aperture to f/8 to f/11 (or f/16, at most).
> ...



+1 for each point. 

The f22 slipped right by me


----------



## mackguyver (Mar 14, 2015)

ray5 said:


> mackguyver said:
> 
> 
> > I think the OP is talking about focus stacking for sharpness & DOF, not macro. I.e. taking several frames at the lens's optimal aperture (f/5.6) at different focus settings and stacking them for optimal sharpness and DOF. This is a different technique and doesn't require rails or anything else. The only snag is with varifocal lenses (most Canon AF lenses) as the focus breathing will reduce the field of view. This is particularly annoying on the 70-200 f/2.8 II, and this technique works best on parfocal lenses where the FOV stays the same during focus adjustments.
> ...


Yes, all settings remain the same other than the focus. You bracket your focus settings so you have them from minimum focus to infinity focus or whatever range is needed. You will also have to figure out how many different photos are needed by the aperture setting.

Parfocal lenses don't "breathe" which means that the framing stays the same throughout the focus range. Varifocal lenses (most AF lenses with rear focusing elements) breathe, so that a 70mm lens at minimum focus becomes something like a 50mm lens and doesn't reach 70mm until infinity. That means that your framing gets cropped as you focus to infinity, and you end up with a 16MP photo, not a 22MP or what have you after you stack the photos.


----------



## quod (Mar 14, 2015)

In my prior post, I forgot to mention my processing. I use Photoshop. I usually use the technique mentioned in the http://digital-photography-school.com/getting-landscapes-sharp-focus-stacking/ article. Photoshop never seems to stack my shots perfectly (it's user error when taking the pictures, not Photoshop), so I will sometimes tweak the masks that are created when it auto-aligns and stacks shots.

In my prior post, I recommend manual focusing. I would like to amend this recommendation. I think AF is fine, just be cognizant of where you are setting your focus. If you use the LiveView/2-second timer technique, it's easy to maneuver the focus point in LiveView and you have 10x magnification to precisely set the point.

Another recommendation is to use a tripod. I assume this is obvious, but maybe not.


----------



## ray5 (Mar 14, 2015)

mackguyver said:


> ray5 said:
> 
> 
> > mackguyver said:
> ...


Wow! The more I learn the more I am astonished at my ignorance!
Thanks


----------



## ray5 (Mar 14, 2015)

quod said:


> In my prior post, I forgot to mention my processing. I use Photoshop. I usually use the technique mentioned in the http://digital-photography-school.com/getting-landscapes-sharp-focus-stacking/ article. Photoshop never seems to stack my shots perfectly (it's user error when taking the pictures, not Photoshop), so I will sometimes tweak the masks that are created when it auto-aligns and stacks shots.
> 
> In my prior post, I recommend manual focusing. I would like to amend this recommendation. I think AF is fine, just be cognizant of where you are setting your focus. If you use the LiveView/2-second timer technique, it's easy to maneuver the focus point in LiveView and you have 10x magnification to precisely set the point.
> 
> Another recommendation is to use a tripod. I assume this is obvious, but maybe not.


I will try it out. Thanks for all your help.
Ray


----------



## ray5 (Mar 14, 2015)

quod said:


> The articles/videos posted already provide a good background on focus stacking. Here is yet another article:
> http://www.stevemackayphotography.com/section363141_130929.html
> 
> Even though I enjoy Gavin Hoey's tutorials, in the video posted by YuengLinger, he shoots at f/22, which I do not recommend because diffraction will kill some of the sharpness that you are seeking to get from focus stacking. I suggest setting your aperture to f/8 to f/11 (or f/16, at most).
> ...


This may sound very ignorant, but when I shift the focus point, do they have to overlap a bit with the previous one? Or since the composition is the same the software will detect the best in focus areas and make a composite? Thanks


----------



## mackguyver (Mar 14, 2015)

ray5 said:


> quod said:
> 
> 
> > The articles/videos posted already provide a good background on focus stacking. Here is yet another article:
> ...


As long as you don't move the tripod/camera, you're good. Like I said, the framing may change somewhat, but don't worry about that. Also, the parfocal vs. varifocal thing was something I learned about when I tried this very technique, but it's a big deal to the video guys as they want the framing to stay the same as they focus track a subject through the frame.


----------



## quod (Mar 14, 2015)

ray5 said:


> This may sound very ignorant, but when I shift the focus point, do they have to overlap a bit with the previous one? Or since the composition is the same the software will detect the best in focus areas and make a composite? Thanks


Take a look at the Steve Mackay article I posted. He walks through his focus points.

Link: 
http://www.stevemackayphotography.com/section363141_130929.html

Each "shot" that you are creating is unique, so it depends. In the shot below, I focused on the foreground flowers and on the building in the back. I should have focused on the water to add more sharpness, but it was an HDR focus stack and I was trying to move quickly, so I forgot to do it.


----------



## tolusina (Mar 14, 2015)

quod said:


> ....
> 
> 
> 
> ...


Very nice!!


----------



## ray5 (Mar 14, 2015)

quod said:


> ray5 said:
> 
> 
> > This may sound very ignorant, but when I shift the focus point, do they have to overlap a bit with the previous one? Or since the composition is the same the software will detect the best in focus areas and make a composite? Thanks
> ...


Lovely image and also one of my favorite spots to photograph.
So do I understand correctly that you focus front to back or back to front like you mention and in the article. And you cannot/should not or less desirable to focus side to side?


----------



## pwp (Mar 14, 2015)

Lens "breathing"...yes the 70-200 f/2.8isII has caught me out a few times. 
Does the 100mm L f/2.8is macro breathe? 
Which lenses don't breathe?

-pw


----------



## Marsu42 (Mar 15, 2015)

pwp said:


> Does the 100mm L f/2.8is macro breathe?



The 100L has heavy breathing. That's the problem with just using Magic Lantern's focus stacking and having the lens on a fixed point, it's "missing" data behind objects. I imagine the only way to get around this problem is to use a macro rail which adjusts the distance to compensate.


----------



## Hillsilly (Mar 15, 2015)

A Serge Ramelli video with Photoshop steps - https://www.youtube.com/watch?v=JiVdun6d90Q


----------



## quod (Mar 15, 2015)

ray5 said:


> Lovely image and also one of my favorite spots to photograph.
> So do I understand correctly that you focus front to back or back to front like you mention and in the article. And you cannot/should not or less desirable to focus side to side?


Thanks. I focus front-to-back (or vice-versa). I'm not sure if I understand what you mean by side-to-side.


----------



## ray5 (Mar 15, 2015)

Hillsilly said:


> A Serge Ramelli video with Photoshop steps - https://www.youtube.com/watch?v=JiVdun6d90Q


He is good, I have seen many of his tutorials, thx.


----------



## ray5 (Mar 15, 2015)

quod said:


> ray5 said:
> 
> 
> > Lovely image and also one of my favorite spots to photograph.
> ...


I think I now understand why it has to be front to back or vice versa to do what this means to do, DOF. What I was referring to when I said side to side is if you are viewing the composition from the side of the frame to the other side instead of top/bottom.
For example, shooting a bridge over a river from a boat bang in the middle of the river. But I understand you can't do focus stacking end to end of the bridge as each frame might be on the same plane. But what if you are on on river bank? But I think it will still work better to go close to far or vice versa rather than side to side. I am not sure if I am making sense. Thanks,
Ray


----------



## quod (Mar 15, 2015)

ray5 said:


> I think I now understand why it has to be front to back or vice versa to do what this means to do, DOF. What I was referring to when I said side to side is if you are viewing the composition from the side of the frame to the other side instead of top/bottom.
> For example, shooting a bridge over a river from a boat bang in the middle of the river. But I understand you can't do focus stacking end to end of the bridge as each frame might be on the same plane. But what if you are on on river bank? But I think it will still work better to go close to far or vice versa rather than side to side. I am not sure if I am making sense. Thanks,Ray


You want to work along your focus plane. Usually this is parallel with the sensor, although tilt-shifts can alter the angle of the focal plane. Regardless of the lens you use, if you want something to be sharp and it is not sharp given your current focus point, you will want to take a shot that will include that area in the focus plane. Does that make sense?


----------



## ray5 (Mar 15, 2015)

quod said:


> ray5 said:
> 
> 
> > I think I now understand why it has to be front to back or vice versa to do what this means to do, DOF. What I was referring to when I said side to side is if you are viewing the composition from the side of the frame to the other side instead of top/bottom.
> ...


Yes, you nailed it, parallel to sensor. Thanks a lot for your patience.
Ray


----------



## sanjosedave (Mar 17, 2015)

In the image attached, are 1-5 considered 'in parallel' to the sensor


----------



## ray5 (Mar 17, 2015)

sanjosedave said:


> In the image attached, are 1-5 considered 'in parallel' to the sensor


Excellent, thanks. I think I'll try it out at home before venturing out. Don't know if PS CS5 has focus stacking?


----------



## quod (Mar 17, 2015)

Yes, PS CS5 has stacking built in.


----------



## ray5 (Mar 17, 2015)

quod said:


> Yes, PS CS5 has stacking built in.


Thanks


----------



## pwp (Mar 18, 2015)

Marsu42 said:


> pwp said:
> 
> 
> > Does the 100mm L f/2.8is macro breathe?
> ...



Thanks for the 100L heavy breathing advice. I'll keep it locked away.

-pw


----------



## Zeidora (Mar 24, 2015)

ray5 said:


> quod said:
> 
> 
> > Yes, PS CS5 has stacking built in.
> ...


Was very un-impressed with CS5 stacking. It may work OK with few images (5-6), but once you go toward 50-100 frames, it produces unusable garbage. Same is true for the Zeiss ZenBlue Extended Focus module; not quite as bad as PS CS5, but still unusable beyond 5-6 frames. HeliconFocus and ZereneStacker are the go-to solutions, IMHO. ImageJ may be a further option, but have not tried it. CombineZ is used by some on PCs.


----------

