1. A method for image processing, comprising: receiving in a computerized image processor a source image having a source size and a definition of a target size that is different from the source size; defining a plurality of different sequences of two or more different image retargeting operations that when applied to the source image, generate respective target images of the target size; automatically testing, using the image processor, the different sequences by measuring respective similarities of the respective target images to the source image; selecting one of the sequences responsively to the similarities; and applying the selected one of the sequences to the source image, using the image processor, in order to generate a target image.