Starting from the properties of a neural network with backward lateral inhibitions, we define a new algorithm suitable for non-linear image processing. From a convenient choice of the network parameters we obtain, after an initial smoothing effect, either a sharpening effect, or a spatial sampling adapted to the singularities of the input pattern