Models and algorithms in image processing are usually defined in the continuum and then applied to discrete real data, that is the image data is an array of real values obtained by the signal samples over a lattice. In particular, the set up in the continuum of the segmentation problem allows a fine formulation basically through either a variational or a non linear anisotropic diffusion equation approach. In any case the image segmentation is obtained as the steady state solution of a non linear PDE which evolves the initial data. Nevertheless the application to real data requires discretization schemes where some of the basic image geometric features have a loose meaning. In this paper we investigate a discrete version of the level set formulation of the Mumford and Shah energy functional, and the optimal image segmentation is directly obtained throught a non linear finite difference equation. The typical characteristics of the segmentation problem, such as the boundary, its lenght, the segmentation component domainsarea, are all defined in the discrete context thus obtaining a more realistic description of the available data.