ToolsConductScience tool
Image AnalysisFree in-browser calculator

Porosity Calculator.

Upload a micrograph, apply Otsu thresholding, and calculate porosity as area fraction. Client-side processing — images never leave your browser.

PrivateData stays in your browser
LiveNo sign-up required
Validated2026-04-05
CitableMethods and citation included

Calculator

Results update in place

Try it out

Load example porosity data to see the full workflow

Upload a micrograph

Drag & drop or click to browse — any image format

When to use

  • Estimate porosity (area fraction) from metallographic or ceramic micrographs
  • Quick threshold analysis of SEM or optical microscopy cross-sections
  • Educational demonstrations of Otsu thresholding and image binarization
  • Compare porosity across different processing conditions or sample locations
  • Screen cast, sintered, or additively manufactured parts for void content

Do not use for

  • Images with severe uneven illumination (use local adaptive thresholding)
  • Multi-phase materials where pores are not the darkest (or brightest) phase
  • 3D porosity measurement — use micro-CT or Archimedes method
  • Formal ASTM compliance reporting without multi-field analysis

Check the histogram before trusting the Otsu value

Otsu's method assumes a bimodal histogram. If your histogram is unimodal (e.g., very low porosity < 2%), multimodal, or has a long tail, the automatic threshold may be suboptimal. Always inspect the histogram overlay and adjust manually if the binary image doesn't visually match your assessment of pore locations.

JPEG artifacts create phantom porosity

JPEG compression introduces intensity variations at block boundaries (8x8 pixel blocks) that can be misclassified as pores at certain thresholds. Use PNG or TIFF images when possible. If you must use JPEG, apply a slight Gaussian blur before thresholding (not available in this tool — preprocess in ImageJ or GIMP).

Representative sampling matters more than threshold precision

The single biggest source of error in porosity measurement is usually field-of-view selection bias, not threshold choice. Porosity can vary 2-5x across a sample cross-section. Analyze at least 5 non-overlapping fields at consistent magnification and report the mean and standard deviation.

Magnification affects apparent porosity

At low magnification, small pores below the resolution limit are missed, underestimating porosity. At very high magnification, you see fewer pores per field and the sampling variance increases. Choose a magnification where the smallest pores of interest span at least 3-5 pixels.

1

Method

Grayscale conversion uses ITU-R BT.601 luma weighting (0.299R + 0.587G + 0.114B). Otsu's threshold is computed by maximizing between-class variance over all 256 intensity levels. Porosity is calculated as the ratio of pore pixels to total pixels. The 95% confidence interval is derived from the binomial standard error: SE = sqrt(p(1-p)/n), where p is the area fraction and n is the total pixel count. All processing uses the browser Canvas API — no server upload.

2

Validated

Last validated 2026-04-05. Calculations are designed for planning and documentation support; verify procurement decisions against manufacturer specifications or institutional SOPs.

3

How to cite

How to Cite

ConductScience Porosity Estimator (v1.0). ConductScience, Inc. 2026. Available at: https://conductscience.com/tools/porosity-estimator

Otsu N. A threshold selection method from gray-level histograms. IEEE Trans Syst Man Cybern. 1979;9(1):62-66. doi:10.1109/TSMC.1979.4310076

ASTM E1382-97. Standard Test Methods for Determining Average Grain Size Using Semiautomatic and Automatic Image Analysis. ASTM International. doi:10.1520/E1382-97R23

What Is Porosity Measurement in Materials Science?

Porosity — the volume fraction of void space in a solid — is one of the most fundamental microstructural parameters in materials science. It governs mechanical properties (strength, stiffness, fatigue life), transport properties (permeability, diffusivity), and functional performance (thermal insulation, biocompatibility).

Common measurement techniques include Archimedes' method (buoyancy), mercury intrusion porosimetry, gas adsorption (BET), micro-CT, and image analysis. Image-based methods using optical or electron micrographs provide spatial information that bulk methods cannot: pore size distribution, shape, connectivity, and spatial arrangement.

The simplest image analysis approach is global thresholding — converting a grayscale micrograph to binary (pore vs. matrix) using an intensity cutoff, then counting the fraction of pore pixels. Otsu's method automates the threshold selection step.

Understanding Otsu's Thresholding Method

Nobuyuki Otsu published his automatic thresholding method in 1979. The algorithm assumes the image histogram is bimodal — two overlapping distributions representing two phases (e.g., pores and matrix). It exhaustively tests every possible threshold from 0 to 255 and selects the one that maximizes the between-class variance:

σ²_B(t) = ω₀(t) · ω₁(t) · [μ₀(t) − μ₁(t)]²

where ω₀ and ω₁ are the class probabilities and μ₀ and μ₁ are the class means at threshold t.

Otsu's method works well when the histogram is clearly bimodal with similar class sizes. It can struggle with highly skewed distributions (very low or very high porosity), uneven illumination, or multimodal histograms. In these cases, manual threshold adjustment or local adaptive thresholding may be needed.

Relevant Standards for Porosity Measurement

Several ASTM and ISO standards govern image-based porosity and phase fraction measurement:

  • ASTM E1382: Standard Test Methods for Determining Average Grain Size Using Semiautomatic and Automatic Image Analysis — includes area fraction procedures applicable to porosity.
  • ASTM E562: Standard Test Method for Determining Volume Fraction by Systematic Manual Point Counting — the manual grid-based predecessor to automated image analysis.
  • ASTM B311: Standard Test Method for Density of Powder Metallurgy (PM) Materials — Archimedes method for bulk porosity.
  • ISO 9276: Representation of results of particle size analysis — relevant for pore size distributions.

For formal reporting, multiple fields of view (typically 5+) should be analyzed, and results reported as mean ± standard deviation with the number of fields, magnification, and thresholding method documented.

Frequently asked

325
Free tools
1,200+
Institutions
100%
Client-side
0
Uploads required