We present a method for automatic image retrieval based on query-by-example (QBE). The proposed method consists of two parts: region selection followed by shape matching. In the first part, the image is partitioned into disjoint, connected regions with more-or-less uniform color, whose boundaries coincide with spatial edge locations. The number and boundaries of resulting regions are adaptively determined by a new fusion technique for combined color segmentation and edge linking. Each region or combinations of neighboring regions constitute 'potential objects.' In the second part, the shape of each potential object is tested to determine whether it matches one from a set of given templates. To this effect, the boundary of each potential object, as well as of each template, is represented by a B-spline. We then proceed to identify correspondences between the joint points of the B-splines of potential objects and templates, respectively, by using a modal shape description. These correspondences are used to estimate the parameters of an affine mapping to register the object with the template. A proximity measure is then computed between the two contours based on the Hausdorff distance. We demonstrate the performance of the proposed method on a variety of images.