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 not only the transformed image itself but also its associated function, indicating the value of the residue index for which this evolution is the most important. These definitions are totally compatible with the existing definitions for sets. Moreover, they have the advantage of supplying effective tools for shape analysis on one hand and, on the other hand, 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.