# Porosity and pore size from SEM images in ImageJ (AAO, membranes, coatings)

> Porosity and pore size from an SEM image in ImageJ: threshold the pores, read %Area as porosity, then Analyze Particles for pore areas and diameters.

Published 2026-11-06 by LabCanvas team. https://www.labcanvas.com/blog/porosity-pore-size-sem-image

![ImageJ measuring a sample SEM image of anodic alumina: 160 pores outlined in yellow, the Analyze Particles dialog, a Results row with %Area 34.666 (the porosity, Otsu cut at 100) and a Summary of 160 pores with an average size of 3,098.564 nm²](https://www.labcanvas.com/blog/imagej/porosity-pore-size-sem-image-cover.webp)

To measure porosity from an SEM image in ImageJ, threshold the pores (**Image › Adjust › Threshold…**), tick **Area fraction** and **Limit to threshold** in **Analyze › Set Measurements…**, and press **M**: the **%Area** column is the pore area fraction, the surface porosity. For the pore size distribution, run **Analyze › Analyze Particles…** on the same threshold with a minimum size and **Exclude on edges**; each row is one pore, and its equivalent diameter is \(d = 2\sqrt{\text{Area}/\pi}\).

Worked example, on a sample SEM image of anodic aluminium oxide (AAO; synthetic, 1024 × 1024 pixels at 1.25 nm per pixel): with the Otsu threshold, ImageJ 1.54f gives a **porosity of 34.666%** and counts **160 whole pores** with a **mean area of 3,098.6 nm²**, an equivalent diameter of **62.8 nm**.

## What you can and cannot get from a top-view SEM image

Porosity is a volume fraction. An SEM image is a surface. What the image gives directly is the **area fraction of pores at the surface**, often called surface or areal porosity, plus the size and shape of the pore openings.

That area fraction equals the volume porosity in two cases:

- **The structure is the same at every depth.** Ideal AAO has straight, parallel channels of constant diameter, so a top view of a cut surface shows the same fraction as any slice.
- **The structure is random and you measure random sections.** For an isotropic, random microstructure, the area fraction of a phase on random plane sections equals its volume fraction (the Delesse principle of stereology). That applies to polished cross-sections, not to a top view of a surface.

It does not apply to most real top views:

- the surface of a membrane often has a skin, a nucleation layer or widened pore mouths that differ from the bulk;
- a coating or sintered film shows the top grains, with the pores below them hidden;
- closed pores never reach the surface.

For bulk porosity, measure polished or ion-milled cross-sections, use FIB-SEM tomography, or a bulk method (gas adsorption, mercury intrusion, density). Report the SEM number as surface porosity and say so.

## In ImageJ (or Fiji): porosity as an area fraction

### 1. Prepare the image

1. Open the original TIFF, and check the scale in **Image › Properties…** (here 1.25 nm per pixel, read from the file), or set it from the scale bar with **Analyze › Set Scale…**.
2. Crop off the instrument data bar (**Image › Crop** on a rectangle over the image area): its black and white text would be counted as pores and wall.
3. Convert RGB files with **Image › Type › 8-bit**.
4. Optional: **Process › Filters › Median…**, radius 1–2 pixels, to smooth the speckle of the wall. It changes the porosity a little (34.7% raw, 33.7% after a 2-pixel median here), so decide once and use it for every image.

### 2. Threshold the pores

Open **Image › Adjust › Threshold…**. Pores in an SEM image are dark (few secondary electrons escape from them), so untick **Dark background** and choose a method. Zoom in and check that the red fills each pore up to the bright rim of its wall, and no more.

### 3. Measure the area fraction

![ImageJ Set Measurements with Area fraction and Limit to threshold ticked](https://www.labcanvas.com/blog/imagej/porosity-pore-size-sem-image-set-measurements.webp "Analyze › Set Measurements in ImageJ 1.54f: Area fraction adds the %Area column; Limit to threshold makes Measure count only the thresholded red pixels.")

1. In **Analyze › Set Measurements…**, tick **Area fraction** and **Limit to threshold** (and Display label, to know which image a row came from).
2. With no selection (**Edit › Selection › Select None**), press **M** or choose **Analyze › Measure**.

![ImageJ Threshold window and Results row with %Area 34.666 on an AAO image](https://www.labcanvas.com/blog/imagej/porosity-pore-size-sem-image-area-fraction.webp "The AAO sample with the Otsu threshold cut at 100 on the 8-bit scale; pores in red. The Threshold window shows 34.67% of the pixels selected, and Measure with Area fraction and Limit to threshold gives %Area 34.666: the surface porosity.")

**%Area is the percentage of pixels inside the threshold**, here 34.666%, so the surface porosity is 34.7%. The Threshold window shows the same number above its histogram as you move the sliders, which is a quick way to see how sensitive the porosity is to the cut.

To measure a region instead of the whole image (one domain, avoiding a scratch), draw a rectangle first: %Area is then the fraction inside the selection.

## In ImageJ: pore sizes with Analyze Particles

With the threshold still set (or after **Apply** and **Process › Binary › Fill Holes**):

1. **Process › Binary › Watershed**, only if some pores have merged through a thin wall. On this sample it splits a few joined pairs; on irregular pores it can cut one pore in two.
2. In **Set Measurements**, untick Limit to threshold and Area fraction, and tick **Area**, **Shape descriptors** and **Feret's diameter**.
3. **Analyze › Analyze Particles…**: **Size** 500-Infinity nm², **Circularity** 0.60-1.00, **Show** Overlay, and tick **Display results**, **Clear results**, **Summarize** and **Exclude on edges**.
4. Each row is one pore. ImageJ has no equivalent-diameter column: add \(d = 2\sqrt{\text{Area}/\pi}\) per row in a spreadsheet. **Analyze › Distribution…** draws the histogram of any column.

![ImageJ Analyze Particles result on the AAO image: 160 pores and their Summary](https://www.labcanvas.com/blog/imagej/porosity-pore-size-sem-image-pores.webp "Analyze Particles on the AAO sample Otsu, Fill Holes, Watershed; 500 nm² and up, circularity 0.60–1.00, Exclude on edges: 160 pores outlined in yellow, mean pore area 3,098.564 nm², and a Summary %Area of 30.259, which leaves out the pores cut by the frame.")

| Pore statistic (ImageJ, n = 160) | Value |
|---|---|
| Mean pore area ± SD | 3,098.6 ± 364.9 nm² |
| Equivalent diameter of the mean area, \(2\sqrt{\bar{A}/\pi}\) | 62.8 nm |
| Mean of the per-pore equivalent diameters ± SD | 62.7 ± 3.7 nm |
| Mean Feret (largest width) ± SD | 67.0 ± 4.0 nm |
| Mean MinFeret (smallest width) ± SD | 62.5 ± 3.8 nm |
| Pores cut by the frame (with at least 500 nm² inside) | 29 more |
| Surface porosity (Measure, Limit to threshold) | 34.666% |
| Summary %Area of the 160 whole pores | 30.259% |

Note the last two rows. The Summary's %Area counts only the particles that passed the filters, so with Exclude on edges on it misses the cut pores: 30.3% instead of 34.7%. **Take the porosity from Measure with Limit to threshold, not from the Summary.**

Pore density follows from the count. The image is 1,280 nm square, 1.638 µm². Counting the 160 whole pores as one and the 29 cut ones as half gives 174.5 pores, about **107 pores per µm²** (1.07 × 10¹⁰ per cm²).

### Size and circularity filters for pores

![Three crops of the AAO image: no size filter, 500 nm² filter, median filter first](https://www.labcanvas.com/blog/imagej/porosity-pore-size-sem-image-size-filter.webp "Left: with no minimum size, ImageJ counts 4,631 objects, most of them dark noise specks in the alumina wall. Middle: from 500 nm², the 160 pores, with ragged outlines mean circularity 0.736. Right: after a 2-pixel median filter, the same 160 pores with smooth outlines mean circularity 0.900.")

- **Minimum size.** The speckle of an SEM wall contains dark pixels that pass the threshold. Without a minimum, this image gives 4,631 "pores". From 500 nm² (320 pixels), only real pores are left. The specks also sit inside the porosity from Measure, which counts every thresholded pixel: pores of 500 nm² and up (cut ones included) cover 33.8% of this image, the specks another 0.9 percentage points. On a noisy image, smooth first or take the area fraction from a mask filtered by size (**Show: Masks** with Exclude on edges off, then Measure the mask with Area fraction ticked: 33.7% here).
- **Circularity.** A range of 0.60–1.00 is meant to drop merged pores and odd shapes. On this sample it removes nothing: the mean circularity of the pores is 0.736 on the raw image, because the noisy outline is long, and 0.900 after a median filter. Check the circularity values of your own pores before choosing a cut-off, and see [Feret diameter, circularity and solidity](https://www.labcanvas.com/blog/feret-diameter-circularity) for why noise lowers it.

## Pitfalls

- **The threshold decides the porosity.** On this AAO image, ImageJ's automatic methods give from 33.1% to 40.3%:

| Method | Cut (8-bit) | Porosity (%Area) |
|---|---|---|
| Huang | 91 | 33.1% |
| Li, Minimum | 92 | 33.3% |
| Intermodes | 95 | 33.8% |
| Triangle | 96 | 33.9% |
| Default, IsoData, Otsu | 100 | 34.7% |
| Mean | 114 | 39.3% |
| MaxEntropy | 116 | 40.3% |

  Seven percentage points between methods, on a clean synthetic image. Pick the method by eye on a zoomed edge, use it for the whole series, and report it with the cut value. [ImageJ threshold methods compared](https://www.labcanvas.com/blog/imagej-threshold-methods) shows them side by side.
- **Bright pore rims.** Secondary-electron images make the edge of each wall glow (the edge effect). If the threshold cuts through the glow, pores come out smaller; a backscattered or in-lens image often has a cleaner edge.
- **Conductive coatings narrow the pores.** A few nanometres of sputtered gold or platinum on the walls make every pore a few nanometres smaller in diameter, a large share of a 20 nm pore. Use the thinnest coating that works, or none at low voltage.
- **Charging and drift** blur and stretch the image: check that round pores look round.
- **Too few pores, one image.** One field is one place on the sample. Measure several fields, and report the spread between them.
- **Calling it volume porosity.** See the first section: a top view gives surface porosity.

## Reporting it

> Surface porosity and pore size were measured on top-view SEM images (1.25 nm per pixel; n images) in ImageJ 1.54f (Schneider et al., 2012). Pores were segmented with the Otsu threshold (cut at 100 on the 8-bit scale); the surface porosity is the area fraction of the thresholded pixels. Pore areas were measured with Analyze Particles (holes filled, touching pores separated by watershed, objects smaller than 500 nm² and pores touching the image edge excluded) and converted to equivalent circle diameters, d = 2√(A/π).

Report the porosity as surface porosity with the threshold method, the pore diameter as mean ± SD with n, and show the histogram of diameters next to a representative image with a scale bar.

## Where Fiji does more: 3D porosity and hard segmentations

For FIB-SEM stacks and X-ray tomography, Fiji has 3D tools (3D Objects Counter, MorphoLibJ's 3D measurements) that measure true volume porosity and pore connectivity, which no top view can give. When pores and wall cannot be split by one threshold, as on a rough coating, Fiji's Trainable Weka Segmentation learns the two classes from a few strokes you draw, and Analyze Particles then runs on its result.

## An easier way: porosity and pore size in LabCanvas

[LabCanvas Image Analysis](https://www.labcanvas.com/analysis.html) gives the porosity and the pore sizes from one panel, in the browser, with nothing to install. On the same file:

1. Click **Open an image** and choose the TIFF; the 1.25 nm pixel size is read from it.
2. In **Count › Count particles**, set the threshold to **Otsu** and objects to **Dark**. Next to the threshold value the panel shows the share of the image on the pore side of the cut: **34.7%**, the surface porosity.
3. Tick **Fill holes**, **Separate touching objects (watershed)** and **Exclude particles on the edges**; size from 500 nm², circularity 0.6–1 under **More options**. Click **Count**.
4. **Send to Graphs** turns the Area column into a histogram (transform it with Y = 2*sqrt(Y/pi) for diameters); **Count › Batch** runs the same settings on every image of a series.

![Pore size and porosity AAO in LabCanvas Image Analysis](https://www.labcanvas.com/analysis-examples/em-aao-pores.webp "Pore size and porosity AAO: 160 pores counted those cut by the frame left out: mean area 3,099 nm², an equivalent diameter of 62.8 nm; the pores take up 34.7% of the surface porosity.")

On the AAO sample LabCanvas gives **160 pores, mean area 3,099 nm², an equivalent diameter of 62.8 nm and 34.7% porosity**; ImageJ 1.54f gave 160 pores, 3,098.6 nm², 62.8 nm and 34.666%, the same to the last digit shown. Its result line, like ImageJ's Summary, gives the area of the counted pores (30.3% of the image), and the threshold share next to it gives the porosity, so the two are not confused.

Why it is a good choice for pore images:

- **Nothing to install**: it runs in the browser on any computer, including the PC next to the SEM.
- **Porosity and pore sizes in one panel**, with ImageJ's definitions (Area, %Area, Feret, circularity).
- **An image check** that flags clipped pixels, JPEG compression and uneven brightness before you threshold.
- **Straight into Graphs** for the size histogram, and a **Methods** sentence above the results to copy.
- **Free with a LabCanvas account**; downloading CSV files is part of LabCanvas Pro. The measurements are checked in [more than 4,000 automated tests](https://www.labcanvas.com/image-analysis-validation).

LabCanvas works on 2D images and on stacks slice by slice, so for volume porosity use Fiji's 3D tools above. [Open Image Analysis](https://www.labcanvas.com/analysis.html) and measure the pores in your own SEM image. ImageJ and Fiji are independent open-source projects; LabCanvas is not affiliated with them.

## References

- Schneider CA, Rasband WS, Eliceiri KW (2012). NIH Image to ImageJ: 25 years of image analysis. *Nature Methods* 9(7): 671–675. [doi:10.1038/nmeth.2089](https://doi.org/10.1038/nmeth.2089)

## Frequently asked questions

### How do I measure porosity from an SEM image in ImageJ?

Threshold the pores with Image › Adjust › Threshold so that they are red, tick Area fraction and Limit to threshold in Analyze › Set Measurements, and press M (Analyze › Measure). The %Area column is the area fraction of the pores, the surface porosity. On our AAO sample it is 34.666% with the Otsu threshold.

### How do I get a pore size distribution from SEM in ImageJ?

With the pores thresholded, run Analyze › Analyze Particles with a minimum size to drop noise and Exclude on edges, and Display results ticked. Each row is one pore; convert the areas to equivalent diameters with \(d = 2\sqrt{\text{Area}/\pi}\) and plot their histogram (Analyze › Distribution… draws one from any column).

### Is the porosity from an SEM image the same as the bulk porosity?

Not in general. A top-view SEM image gives the area fraction of pores at the surface. It equals the volume porosity only for structures that look the same at any depth (straight, uniform channels like ideal AAO) or for random, isotropic structures measured on random cross-sections. For bulk porosity use cross-sections, FIB-SEM tomography, or gas adsorption and mercury porosimetry.

### Why is the Summary %Area of Analyze Particles lower than the porosity?

With Exclude on edges on, the Summary %Area counts only the whole pores, not the ones cut by the frame, and a size filter leaves out small pores too. On our sample the Summary says 30.259% while the true pore area fraction is 34.666%. Read porosity from Measure with Limit to threshold instead.

### Which threshold method should I use for pores?

One that puts the cut where the pore walls are, checked by eye at 200–400% zoom, and the same one for every image in a series. Porosity is sensitive to it: on our AAO sample the methods in ImageJ give from 33.1% (Huang) to 40.3% (MaxEntropy). Report the method and the cut.

## Related links

- [Analyze Particles in ImageJ, explained](https://www.labcanvas.com/blog/analyze-particles-imagej): Every option of the dialog, with examples
- [Grain size analysis in ImageJ (SEM, ASTM E112)](https://www.labcanvas.com/blog/grain-size-analysis-sem): The same counting route for grains
- [Feret diameter, circularity and solidity](https://www.labcanvas.com/blog/feret-diameter-circularity): Shape descriptors and why circularity depends on noise
- [ImageJ threshold methods compared](https://www.labcanvas.com/blog/imagej-threshold-methods): The same image under all 16 methods
- [BET surface area calculator](https://www.labcanvas.com/tools/bet-surface-area-calculator): Surface area from a gas adsorption isotherm
- [Image Analysis: the complete guide](https://www.labcanvas.com/blog/image-analysis-complete-guide): Every tool and setting in the app
