Binary morphological transformations based on the residues (ultimate erosion, skeleton by openings, etc.) are extended to functions by means of the transformation definition and of its associated function based on the analysis of the residue evolution in every point of the image. This definition allows to build the transformed image and its associated function, indicating the value of the residue index for which this evolution is the most important. These definitions have the advantage of supplying effective tools for shape analysis and of allowing the definition of new residual transforms together with their associated functions. Two of these numerical residues will be introduced, called respectively ultimate opening and quasi-distance and, through some applications, the interest and efficiency of these operators will be illustrated. Finally, this residual approach will be extended to more complex operators. Keywords Image analysis, mathematical morphology, residues, ultimate opening...