Focus Stacking: The Secret to Beautiful Photos


Since I first upgraded to a proper DSLR, I’ve been continually messing around with different techniques to see just what the capabilities of this awesome little device are, and, thus far, I haven’t been disappointed. It’s strange. It’s such a simple device, but it really does seem like, in the hands of a talented user, so much potential can be coaxed out of it If you’ve watched this channel for a while, you’ll know that I’m not shy about using a microscope, but I’ve always struggled to take nice photos. It’s an unfortunate side effect of microscopes and optics that not everything in view is in focus, and the more you zoom in, the less area is in focus at once. A few months ago, Daniel Matthews commented and suggested that I try focus stacking, and, having never heard of the technique, I looked it up. The results spoke for themselves: Perfectly clear images of tiny things with all the detail plain to see. I knew I had to try it. Now I know there’s a million and three videos on this topic already, but I wanted to do my own take on it, so that I could show off my learning process. Also, I didn’t realize until I was already filming this, but Ben over at applied science also has a great video on the topic which you may want to check out as well. So what is focus stacking, and how does it work? The basic idea is really straightforward: As you’re taking a photo, be it through microscope, macro lens, or otherwise, there’ll be some parts of the image that are in focus and some that aren’t. As you adjust the focus, different areas will come into focus By taking a series of images as you adjust the focus and combining them in programs like Photoshop, you can cut out the out-of-focus parts and just keep the in-focus parts. This makes photos with incredible depth and preserves much more detail than any single photo. Let’s work through an example to see how this whole process works. To start, let’s take some photos through a microscope. I bought a cheap $8 adapter for my camera, so that it can be fit into one of the ocular holes of the microscope You can get fancier ones, but I found the cheap one worked well enough and I didn’t feel like spending $90 for an adapter. I set up a fresh microscope slide to act as a platform for specimens. I collected a couple of small insects from our mini bug zapper and placed them on the platform. I set the microscope to its lowest magnification, and started looking around for a good shot. I had actually tried this earlier with some hemp and a piece of Spanish moss, but realized that opaque objects that are only backlit look awful. So for the flies, I added a secondary light source, in this case, one of the LED lights I normally use for lighting jammed into the crook of the microscopes neck. This turned out to be the perfect angle and amount of light, and by just quickly adjusting the ISO and aperture on the camera, I was able to get a really nice shot. I’m using a remote shutter release both because it’s easier, and then because you’re also less likely to bump something and have to start again. Using this wing as our first target, you can see that only a strip of the wing is ever in focus at a time. Start by taking a photo where one edge of the wing is in focus then slowly tune the fine adjustment until a new area is in focus, then take another picture. Repeat this until you’ve covered everything. Once you’ve taken a bunch of images of different objects, I like to load them into Lightroom because I shoot at raw quality, so the files are quite large and come in in the .nef format. By loading them into Lightroom, it lets me quickly convert everything to JPEGs, and it preserves the detail really well. Then, moving over to Photoshop, we go to file->scripts->”load files into stack.” Click “browse” and find the files you want. Select them all and click OK. After a second, all of the photos that you’ve just selected are loaded into individual layers. Select all the layers and then go to edit->”Auto align layers.” Choose “auto” and click OK. This warps and bends the photos so that all the in-focus bits will line up as well as possible once we clip out all the out-of-focus bits Most of the time this warping leaves empty edges. so I like to clean this up by using the rectangular marquee tool to select a nice area and then crop the photo. Then with layers still selected, go to edit->”auto blend layers,” and then click OK. And that’s it! That’s all the work done. Let the computer think, and in a moment, out pops a usually stunning, focus-stacked image. This technique works with any photos where things will hold still long enough that everything lines up at the end and there’s a large focal distance between objects and frame. I loved using this technique for microscopy and I captured a ton of cool photos which I’ll talk about it in a minute, but the technique also works for macro photography and even landscapes. I’ve linked to a gallery of the images I took in the description, but for now here’s some before-and-after shots. The process is almost always the same, though which photos you choose and how many you use for each subject will vary a lot. Some things need more photos to cover everything, but some, like these wisteria, only needed two. Use your judgement to divide the whole focus pan into an appropriate number of photos, and don’t think that more is necessarily better. There’s only so much that the program can do and too many photos can confuse it and give an actually worse result. So, try and be conservative. It seemed like, about 10 was as many as I ever needed, but your results may vary and you may need more or less. An important thing to note is that this technique doesn’t always work. You can see from these that sometimes the program just can’t quite figure things out and so the results are really off. I found this happened more with back-lit things than it did with top-lit stuff, so that’s something else to consider. So that’s focus stacking. I won’t go into more detail because there’s tons of other tutorials already, but I will say that I’m going to be using this technique a lot moving forward. I absolutely love it and the images continue to be spectacular, so thanks again, Daniel Matthews, for your great suggestion. This video covers ideas which we’ll be using in the future, specifically stacking. Stacking can be used for all sorts of things especially astrophotography. Since my tracking mount is absolute garbage, it’s become a vital tool for my continued exploration of the night sky, and I look forward to teaching you all about it in the future. If you enjoyed this video, be sure to subscribe and click the bell icon to see when I post new videos. If you want some science themed merch or just want to support the show, head over to my store on Redbubble to see all the awesome designs I have up. If you have suggestions for future videos be sure to leave them in the comments. I love reading your suggestions and may well make it into a video like this one. As always a big thanks to my patrons who help make this show possible. That’s all for now, and I’ll see you next time

44 Comments

Add a Comment

Your email address will not be published. Required fields are marked *