Aluminium foam elements foamed into moulds, have a porous core, surrounded by a thin layer of non-porous outer surface. This layer affects the homogeneity and mechanical properties of the element significantly. To produce functional elements, the foams can be machined to a desired end shape. Machining deforms the surface structure, which results in a reduction of strength properties. This article describes an experimental approach to determine the effects of machining parameters on the surface porosity of closed-cell aluminium foam samples. The samples were machined by incremental forming and friction rolling with precisely defined processing parameters (deformation depth, feed rate and spindle speed). High-resolution digital photos of the treated surfaces were taken and analysed using image segmentation with a multispectral threshold algorithm. The change of surface porosity was calculated for each sample, and the influence of the selected machining parameters was determined by the use of response surface methodology. The optimal machining parameters are presented.