GitPedia

Surfalize

A python module to analyze surface roughness and periodic texture parameters

From fredericjs·Updated June 23, 2026·View on GitHub·

[![Publication](https://img.shields.io/badge/Publication%20-%2010.3390%2Fnano14131076%20-%20%20%2385c1e9%20 )](https://doi.org/10.3390/nano14131076) The project is written primarily in Python, distributed under the GNU General Public License v3.0 license, first published in 2023. Key topics include: iso-25178, keyence, microtexture, moutainsmap, periodic-structure.

<h1 align="center"> <img src="https://raw.githubusercontent.com/fredericjs/surfalize/refs/heads/main/logo.svg" width="600"> </h1><br>

PyPI version
Documentation Status
Python Package Tests
Publication

surfalize is a python package for analyzing microscope topography measurement data in terms of surface
roughness and other topographic parameters. It is intended primarily for microtextured surfaces and is supposed to
replace software packages such as MountainsMap, MultiFileAnalyzer and Gwyddion for the most common tasks.

Surfalize WebApp (beta)

Surfalize is now also available as an interactive webapp under surfalize.com, running entirely clientside powered by pyodide.

Disclaimer

The authors make no guarantees for the correctness of any results obtained using this package. The package is an early work in progress
and may introduce changes to both implementation details and public API at any point in time. Any results should be validated against established
software to verify their correctness, especially when they are intended to be used for scientific publications.

Some parts of the package are more mature and some are in early development stage.

Cite this library

If you publish data generated with this library, please consider citing this publication:

F. Schell, C. Zwahr, A. F. Lasagni. Surfalize: A Python Library for Surface Topography and Roughness Analysis Designed
for Periodic Surface Structures. Nanomaterials. 2024, 13, 1076.

How to install

To install the latest release of surfalize, run the following command:

commandline
pip install surfalize

If you want to install from source, clone this git repository and run the following command in the root folder
of the cloned repository.

commandline
pip install .

While earlier versions used Cython, the current version is pure Python and can be installed without a C-compiler.

Documentation

The documentation is hosted on readthedocs.

Currently supported file formats

ManufacturerFormatReadingWriting
Keyence.vk4, .vk6, .vk7YesNo
Keyence.cagOnly extractionNo
Leica.pluYesNo
Sensofar.plu, .pluxYesNo
Digital Surf.surYesYes
KLA Zeta.zmgYesNo
Wyko.opdYesNo
Nanofocus.nmsYesNo
Alicona.al3dYesYes
Digital Surf.sdfYesYes
Gwyddion.gwyYesNo
Digital Metrology.os3dYesNo
IAU FITS Working Group.fitsYesNo
Zygo.datYesNo
OpenFMC.x3pYesNo
TrueMap.tmdYesYes
General.xyzYesNo

Supported roughness parameters

This package aims to implement all field parameters defined in ISO 25178-2:2021. Currently, the following parameters
are supported:

CategoryParameterFull nameValidated against
HeightSaArithmetic mean heightGwyddion, MountainsMap
SqRoot mean square heightGwyddion, MountainsMap
SpMaximum peak heightGwyddion, MountainsMap
SvMaximum valley depthGwyddion, MountainsMap
SzMaximum heightGwyddion, MountainsMap
SskSkewnessGwyddion, MountainsMap
SkuKurtosisGwyddion, MountainsMap
HybridSdr<sup>1</sup>Developed interfacial area ratioGwyddion<sup>2</sup>, MountainsMap
SdqRoot mean square gradientMountainsMap
SpatialSalAutocorrelation length-
StrTexture aspect ratio-
StdTexture direction-
SswDominant spatial wavelength-
FunctionalSkCore roughness depthMountainsMap
SpkReduced peak heightMountainsMap
SvkReduced dale heightMountainsMap
SpkxMaximum peak height-
SvkxMaximum pit depth-
Sak1Area of the hills-
Sak2Area of the dales-
Smr1 / Smrk1Material ratio 1MountainsMap
Smr2 / Smrk2Material ratio 2MountainsMap
Smr(c)Areal material ratioMountainsMap
Smc(mr)Inverse areal material ratioMountainsMap
SxpPeak extreme heightMountainsMap
SdcMaterial ratio height difference-
Functional (volume)VmpPeak material volumeMountainsMap
VmcCore material volumeMountainsMap
VvvDale void volumeMountainsMap
VvcCore void volumeMountainsMap
Vm(p)Material volume-
Vv(p)Void volume-

<sup>1</sup> Per default, Sdr calculation uses the algorithm proposed by ISO 25178 and also used by MountainsMap
By keyword argument, the Gwyddion algorithm can be used instead.
<sup>2</sup> Gwyddion does not support Sdr calculation directly, but calculates surface area and projected
area.

Supported profile roughness parameters

The Profile class supports the calculation of profile roughness parameters. Profiles can be extracted from a
Surface (e.g. via get_horizontal_profile, get_vertical_profile or get_oblique_profile) or constructed
directly. The peak/valley parameters Rp, Rv and Rz are evaluated per sampling length and averaged over the evaluation
length according to ISO 4287, controlled by the n_sections argument (default 5).

CategoryParameterFull name
HeightRa, Rq, Rp, Rv, Rz, RtAmplitude parameters
Rsk, RkuSkewness, kurtosis
HybridRdqRoot mean square slope
FunctionalRk, Rpk, RvkCore / reduced peak / reduced dale
Rpkx, RvkxMaximum peak height / pit depth
Rak1, Rak2Area of the hills / dales
Rmr1 / Rmrk1, Rmr2 / Rmrk2Material ratios
Rmr(c), Rmc(mr)(Inverse) material ratio
Rxp, RdcExtreme height / ratio height diff
Functional (volume)Vmp, Vmc, Vvv, Vvc, Vm(p), Vv(p)Volume parameters

Supported parameters of 1d-periodic surfaces

Additionally, this package supports the calculation of non-standard parameters for periodic textured surfaces with one-
dimensional periodic structures. The following parameters can be calculated:

ParameterDescription
PeriodDominant spatial period of the 1d-surface texture
DepthPeak-to-valley depth of the 1d-texture profiles
Aspect ratioRatio of peak-to-valley depth to spatial period
HomogeneityHomogeneity factor (0 < H < 1) calculated from Gini analysis
OrientationClockwise angle of the dominant texture to the vertical axis

Supported operations

OperationDescription
LevelingSubtraction of least squares fit to a plane
ZeroingSets the lowest datapoint of the surface to zero
CenteringSets the average value of the surface elevation to zero
ZoomingMagnifies the surface by a specified factor
CroppingCrops the surface in a specified rectangle
RotationRotates the surface by a specified angle in degrees
AlignmentAligns the surface with the dominant texture direction by rotation
Outlier removalRemoves outliers outside n standard deviation from the mean
ThresholdingThresholding based on areal material ratio
FilteringApplies a Gaussian highpass, lowpass or bandpass filter

Contributors

Showing top 7 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from fredericjs/surfalize via the GitHub API.Last fetched: 6/24/2026