A method for compression of images or shape information, comprising the steps of: separating binary shape images into objects; subtracting holes from a representation of the objects; identifying deterministic and stochastic components, and block sizes of the objects based on shapes of the objects; encoding the deterministic components of each object based on first parametric models; encoding the stochastic components of each object with block based methods or chain code; and combining the encoded deterministic components and the encoded stochastic components to provide a compressed encoded output; wherein the step of identifying the deterministic and stochastic component comprises the steps of: obtaining a boundary of an object; storing vertices on the boundary in a point list; generating line segments from the vertices of the point list; extracting the line segments from the object; fitting a second parametric model to the line segments; calculating an approximation error between the second parametric model and the line segments of the object; and comparing the approximation error with a threshold, wherein line segments with an approximation error below the threshold are taken as deterministic components and line segments with an approximation error above the threshold are taken as stochastic components. separating binary shape images into objects; subtracting holes from a representation of the objects; identifying deterministic and stochastic components, and block sizes of the objects based on shapes of the objects; encoding the deterministic components of each object based on first parametric models; encoding the stochastic components of each object with block based methods or chain code; and combining the encoded deterministic components and the encoded stochastic components to provide a compressed encoded output; wherein the step of identifying the deterministic and stochastic component comprises the steps of: obtaining a boundary of an object; storing vertices on the boundary in a point list; generating line segments from the vertices of the point list; extracting the line segments from the object; fitting a second parametric model to the line segments; calculating an approximation error between the second parametric model and the line segments of the object; and comparing the approximation error with a threshold, wherein line segments with an approximation error below the threshold are taken as deterministic components and line segments with an approximation error above the threshold are taken as stochastic components. obtaining a boundary of an object; storing vertices on the boundary in a point list; generating line segments from the vertices of the point list; extracting the line segments from the object; fitting a second parametric model to the line segments; calculating an approximation error between the second parametric model and the line segments of the object; and comparing the approximation error with a threshold, wherein line segments with an approximation error below the threshold are taken as deterministic components and line segments with an approximation error above the threshold are taken as stochastic components. <EOS>