1460753145-d4f115e7-5544-493c-8140-18ac9ca914b8

A method of detecting a gap between a head and a recording medium in an information-recordingreproducing apparatus that uses the head to record and reproduce information in and from the recording medium. In particular, it relates to a first pixel map, including a plurality of white, black and grey scale pixels and gradient directions for one or more of the grey scale pixels, that is resampled to produce a second pixel map using edge geometry data generated from the gradient directions and grey scale values. Said method enables the automatic generation of application files for painting motor vehicle bodies.