← Back to blog

Focus Stacking in Microscopy: Sharp Images at Every Depth

November 20, 2026
Focus Stacking in Microscopy: Sharp Images at Every Depth

Focus stacking combines several photos of the same specimen, each focused at a slightly different depth, into one image that is sharp from top to bottom. You need a compound microscope with smooth fine focus, a camera or smartphone adapter, a steady setup, and stacking software. Capture 5 to 20 frames in equal focus steps, align them, merge them, and check the result for artifacts. This guide walks you through each step.

Wevision
See Microscopic Details Clearly
Explore Wevision microscopes designed for clarity and precision, with setup videos and support to help you use your instrument.
Visit

TL;DR

  • Focus stacking merges frames taken at different focus depths into one image with greater depth of field than any single frame.
  • It helps most with specimens that have real thickness or uneven surfaces, and with higher magnifications where each focal plane is very thin.
  • Practice on a still, prepared slide. Use equal fine-focus steps, plenty of overlap between frames, and a clean sensor or adapter.
  • Free and paid programs can align and merge the frames. Pick the merge method that suits your specimen, then retouch if needed.
  • Treat the result as a visual synthesis of several focal planes, not as a single optical slice.

Table of Contents

What focus stacking does

At the microscope, only a thin slice of the specimen is sharp at any moment. Everything above and below that slice is soft. Your eye hides this problem, because you keep turning the fine focus knob and your brain assembles the full picture. A camera records only one slice per shot.

Focus stacking fixes that. As the Zerene Stacker documentation describes, you load a series of source images, and the software aligns them and keeps the sharpest detail from each. The output is one image with the in-focus regions of every frame blended together.

The steps are always the same:

  1. Capture a series of frames, moving the focus a small, equal amount between shots.
  2. Align the frames so features sit in the same position.
  3. Merge them with a stacking algorithm.
  4. Retouch and save.

Why depth of field gets thin as magnification rises

Depth of field is the thickness of the specimen that looks acceptably sharp at once. It shrinks as magnification and numerical aperture (the objective's light-gathering ability, printed on the barrel) go up. A 4× objective gives you a generous slice. A 40× objective gives you a thin one. A 100× oil objective gives you a sliver.

If you want the numbers for your own objectives, our guide to calculating depth of field and field of view with worked examples shows how. To review how eyepiece and objective combine, see microscope magnification explained.

This is why a photo of a pollen grain, a insect leg or a thick plant section can look half sharp, half blurry. It is not a flaw in your microscope. It is optics. Stacking is the standard way around it.

When focus stacking is worth using

Use it selectively. Field Notes Journal describes it as suited to specimens with significant depth or uneven surface structure, where important features lie on different focal planes. A flat, thin section stained on one layer often needs no stack at all.

Good candidates:

  • Whole mounts of small organisms, such as insect parts, mites or seeds.
  • Textured surfaces, such as fibers, crystals or pollen.
  • Diatoms and other three-dimensional shapes where the rim and center sit at different heights. Our guide to diatom detail for hobbyists pairs well with stacking.
  • Classroom documentation, where students want one clear picture for a lab report.

Michael Much, writing in Microscopy UK, also lists some practical reasons to stack. Stacking keeps the sample in focus as magnification rises. It compensates for objectives that are not fully flat-field. It helps with stages that are not perfectly aligned. And it offsets field curvature, where the edges of the image focus at a different depth than the center.

Poor candidates

Some subjects will not stack well. Living, swimming organisms move between frames. Overlapping transparent structures can confuse the software. If a focus plane is missing from your series, the merged image will have a soft gap. These are the limits G-Scope notes in the Field Notes Journal summary, and they are good reasons to start with still, prepared slides.

How microscope stacking differs from macro stacking

Many stacking tutorials come from macro photography, where you light the front of an opaque object. Microscopy is different. According to the San Francisco Microscopical Society, light usually passes through a translucent sample. Material above or below the focal plane can distort the light passing through the in-focus layer.

The same source notes that macro stacks can combine up to 100 frames, while microscope stacks typically use about 5 to 20. Even two frames can give a noticeable improvement. So you do not need a huge series to get started.

What you need

A stable microscope. A sturdy stand, a smooth fine-focus knob and a mechanical stage that holds the slide without drifting all help. If you are comparing models, our guide to choosing a compound microscope covers the features that matter. Make sure you know what each knob does; our explainer on coarse and fine focus is a quick refresher.

A way to take pictures. A camera on a photo port, or a smartphone on an adapter, both work. Keep the camera fixed and avoid touching it during the series.

Even lighting. Set your illumination and leave it. Changing brightness mid-series shows up as flicker in the merged image. If you are not sure which contrast method suits your specimen, see phase contrast vs brightfield or darkfield basics.

Stacking software. More on that below.

A clean optical path. The Quekett Microscopical Club's stacking guide advises cleaning the camera sensor first, because dust spots create trails that are tedious to remove in post-processing. Clean the eyepiece, objective front lens and slide too, and rule out other causes of softness using our guide to a blurry microscope image.

How to capture a focus stack

1. Start with a still slide and a low objective

Quekett advises practicing on prepared slides that do not move. It suggests starting at ×10 to ×25 total magnification. Above ×40, you need precise fine focus and a steady hand.

2. Set up and focus properly first

Work through your normal setup, including centering the light and focusing on the specimen. If you are new to your instrument, the microscope setup checklist takes you from box to first focused slide.

3. Lock your exposure

Use manual exposure and manual white balance if your camera or phone app allows it. Automatic settings can shift between frames and leave brightness differences in your merged image.

4. Decide your start and end points

Focus on the top of the specimen and note it. Then focus on the bottom. Your series must cover everything between, plus a little extra at both ends. Missing planes leave soft zones that no software can recover.

Focus planes spanning a specimen’s depth

Michael Much begins at the edges of the image area and walks the focus toward the center from shot to shot. Others work from the highest point down to the lowest. Either approach works if you stay in one logical direction.

5. Take frames in equal steps

Quekett recommends approximately equal steps, suited to the subject and magnification, with plenty of overlap, because insufficient overlap causes banding. In practice:

  • Use the fine focus knob, not the coarse one.
  • Turn it the same small amount each time. A pencil mark or a consistent fraction of a turn helps.
  • Pause a moment after each turn so vibration settles.
  • Use smaller steps as magnification rises, since each plane is thinner.

The University of Otago's geology blog guide gives a macro example: step about a thumb width at 1× and use smaller increments as magnification increases. It also says to keep the iris fully open and take more images rather than stopping down. For a compound microscope, adjust the condenser for good contrast and keep it fixed through the series.

6. Take the series, then add a few extra

An extra frame at each end costs seconds. A missing frame costs a retake. The San Francisco Microscopical Society describes three capture routes: stepping the focus by hand, using time-lapse to shoot every second or so while turning the knob slowly, or recording video and converting it to frames with free VLC software. Hand-stepping is the most controlled, and video is the quickest.

7. Check the frames before you leave the microscope

Scroll through the series. Is each frame sharp somewhere? Does every region of the specimen come into focus in at least one frame? Is the brightness steady? If not, redo it while the slide is still on the stage.

Combining the frames in software

Most programs follow a similar workflow. In Zerene Stacker, the documented steps are to add images to the input files list, choose Stack > Align & Stack All (PMax), then save the output through the File menu.

Align first

Alignment matters because the image can shift from camera movement or vibration, and it also corrects parallax. Brecko et al. (2014) call it a critical step. Alignment also keeps the scale consistent: a physical scale bar is valid only if every source image has compatible calibration, so use one scale-bar calibration for all frames.

Choose a merge method

Zerene's documentation describes two complementary methods:

MethodStrengthWatch for
PMax (pyramid)Finds detail in low-contrast or blurred areas and overlapping structuresCan increase noise, contrast and color shifts
DMap (depth map)Preserves original smoothness and colorsFinds less detail

For tricky subjects, you can run both and combine the best parts through retouching.

Software options

The Quekett software list records these prices as of November 2016, so check each vendor's page for current terms:

  • CombineZP: free, but had not been updated since 2010 as of January 2013, and was guaranteed only on Windows XP and Vista.
  • Helicon Focus: $115 for a lifetime standard license, a $30 one-year option, and a $200 Pro version.
  • Zerene Stacker: $89 for a personal license and $39 for a student license, with a free 30-day trial.

The San Francisco Microscopical Society describes the free CombineZP workflow: choose New, load frames in focus order, select All Methods, and click Go. It then shows each algorithm's result side by side so you can compare. Brecko et al. note that Helicon Focus limits a stack to 255 pictures, which is far more than a typical microscope series needs.

If you are a student or teacher on a budget, start with a trial or free program, learn the workflow, and upgrade only if you need more control.

Software options

Expect processing time

In Brecko et al.'s tests, Zerene's PMax and DMap each took roughly three to five minutes per stack on large macro images. Smartphone-sized frames and short microscope series will usually finish faster.

Common artifacts and how to prevent them

Stacking can create its own problems. Here is what to look for and what to do.

ArtifactLikely causeRemedy
Banding or stripesToo little overlap between focus stepsRetake with smaller steps
Dark trails or spotsDust on the sensor or opticsClean before shooting
Halos around fine edgesMerge method struggling with hairs or sharp outlinesTry another method or retouch
Semi-transparent hairs or lost detailFine overlapping structures confuse the softwareRetouch from a single source frame
Shifts in color or contrastPyramid-type methodsCompare with a depth-map result
Flicker in brightnessChanging light or exposure during captureLock exposure and light

Quekett lists banding, dust trails and semi-transparent hairs, and points to single-frame retouching in Zerene Stacker as a powerful fix. Brecko et al. found that pyramid methods commonly cause a slight loss of saturation and increased contrast, while depth methods produced halos all over hairy specimens. The best method depends on the specimen, so try more than one.

Processing also changes how surfaces look, shifting contrast and sheen in a way that echoes the choice between a matte or glossy finish. Keep your editing conservative. Field Notes Journal advises the same, to avoid introducing artifacts of your own.

Remember what a stack is

A stacked image is a visual synthesis of several focal observations, not a literal single-plane view. That is fine for documentation and teaching. For measurement or for judging internal structure, keep a note that the image is a stack and keep the original frames.

Troubleshooting a stack that will not merge well

  • Everything looks soft. Check basic focus and illumination first. Our guide on how to fix a blurry microscope image covers the usual causes.
  • Ghosting. The specimen or slide moved. Secure the slide with the stage clips and let the setup settle.
  • A band that never sharpens. You skipped a focus plane. Retake with smaller steps.
  • Very high magnification is hard. At 40× and above, each plane is extremely thin. Use smaller steps and more frames. For context on what high magnification can and cannot show, see our piece on why 1000× is the limit for home microscopes.

Our perspective

Focus stacking rewards a good optical foundation. The software can only merge what the microscope gives it, so clean glass optics, even illumination and a smooth, controlled fine focus matter more than any program setting.

We build compound microscopes with glass optics, advanced illumination and mechanical stage controls, available in binocular and monocular versions, with smartphone adapters for capture. That combination suits stacking: you can hold the specimen steady, step through focus, and record each plane.

We also know that a new setup can feel like a lot. That is why we publish video demonstrations, setup guides, manuals and FAQs, and answer questions by email. Start with a single prepared slide, a low objective and ten frames. Most people get a clearly better picture on the first try.

https://www.wevision.online

Get a microscope ready for stacking

If you are choosing an instrument for classroom, lab or home use, our premium microscopes offer glass optics, advanced illumination, mechanical stage controls and smartphone adapters, with video demonstrations and setup guides to get you from box to first focused slide. For students, our guide to choosing a microscope for students explains what to look for.

Wevision

FAQ

What is focus stacking in microscopy?

It is a digital technique that combines several images of one specimen, each focused at a different depth, into a single image with more of the specimen in focus. The software picks the sharpest regions from every frame and blends them.

How many images do I need for a microscope focus stack?

The San Francisco Microscopical Society says microscopy typically uses about 5 to 20 frames, and even two can give a noticeable improvement. Thicker specimens and higher magnifications need more frames and smaller steps.

Can I focus stack with a smartphone?

Yes. Attach your phone with an adapter, fix its position, lock exposure and focus if your camera app allows it, and take frames as you turn the fine focus in equal steps. You can also record a short video while turning the knob slowly and extract frames from it, a method the San Francisco Microscopical Society describes using free VLC software.

Does focus stacking work on living specimens?

It is difficult. Movement between frames causes artifacts or a failed merge. Practice on still, prepared slides first, as Quekett advises, then move to more challenging subjects.

What is the best stacking software for beginners?

There is no single answer. Free programs and trial versions let you learn the workflow, and Zerene Stacker's documentation offers a clear step-by-step method with two merge algorithms. Try more than one method on the same stack to see which suits your specimen.

Wevision
Questions About Microscope Setup?
Email Wevision with questions about choosing or setting up a microscope, and find helpful guidance for exploring microscopic details.

Sources