1. A method for retrieving one or more output images, the method comprising: building a learned dictionary of transform codes by examining images in a database for one or more compression patterns and recording said compression patterns in the learned dictionary, wherein the one or more compression patterns comprise one or more transform codes that are learned from the images in the database; receiving a request for one or more output images; transforming the requested output images into requested transform codes; and retrieving said output images from the database by comparing the requested transform codes to the learned transform codes.