Porosity Estimator

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

Image AnalysisOtsu ThresholdArea Fraction

Try it out

Load example porosity data to see the full workflow

Upload a micrograph

Drag & drop or click to browse — any image format

  • 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

Don't 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

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 Questions