This paper presents an approach to texture-based image retrieval which determines image similarity on the basis of the matching of fractal codes. Image fractal codes are generated via a fractal image compression technique that has been recently proposed as an effective image compression method. Each image is represented by a set of self-transformations through which an approximation of the original image can be reconstructed. These self-transformations, which are unique to each image and are semantically rich, are termed fractal codes. An image data model is proposed which constructs each image as a hierarchical structure. Each image is decomposed into block-based segments which are then assembled by a hierarchy on the basis of inclusion relationships. Each segment is then fractally encoded. The fractal codes of an iconic image are used as texture key and are matched with the fractal codes of images in a database by applying searching and matching algorithms to the hierarchies of the database images to locate the segments which best match the fractal codes of the iconic image. Retrievals of both exact and inexact matching of images are supported.