Axis-aligned image retargeting for iOS

This app gives you a new way to modify your photos. It allows you to change the aspect ratio of your images with minimal visual artifacts. Important content, like people or landmarks, can be preserved while parts of the background might get stretched or cropped.

This application was developed in the Bachelor Thesis of Daniel Graf at ETH Zurich. Find out more about it on the research page.

The app is available as a free download in the iOS App Store for the iPad, iPhone, iPod touch and iPad mini.

This application was developed in the Bachelor Thesis of Daniel Graf at ETH Zurich in Winter 2012/13. It implements and extends the axis-aligned image retargeting algorithm by Panozzo et al. A paper about the project was published and presented at VMV 2013 in Lugano.

The thesis was supervised by Dr. Daniele Panozzo and Prof. Dr. Olga Sorkine-Hornung at the Interactive Geometry Lab at ETH Zurich. The underlying optimization problem is solved using CVXGEN, a project by Jacob Mattingley at Stanford. The icon of the app was designed by Felix Hornung.

Feel free to contact us with any questions you might have.

A comparison of our retargeting operator with previous results can be found here.

The source code of this application is freely available on our github repository.

If you are interested in finding out more about the techniques used to implement this application, take a look at the thesis, download the presentation slides or take a look at the page of the publication.


The application consists of two main parts. In the library, you can store and preview all the images that you retargeted so far. In the editor, you can refine and reformat a single image to a new aspect ratio.

Our two videos are the best way to get started if you just want to get a quick overview. The first video shows you how to use the app, while the second video describes what the app does under the hood.
You can find this documentation also inside the app by tapping on and .


To add images to the library use the two buttons on the top left. You can either take a picture with the built-in camera or choose an image from your camera roll.
In order to edit a picture add it to the gallery and then tap on it. To remove a picture from the gallery, tap and hold on the picture and confirm that you want to delete it.
By pinching with two fingers, you can change the size of the thumbnails in the gallery. After the import, the thumbnail will just show the original image. Once you have edited an image the app automatically saves an optimized square thumbnail to use every pixel of your screen.


This is the place where you can change the aspect ratio of an image and paint the important parts of the image. You can start by simply painting into the image with a single finger. You will see that the marked regions will get highlighted in white. To change the aspect ratio, you can use two fingers and swipe up and down to retarget the image. You can also choose one of the predefined aspect ratios by tapping on the little icon with the coordinate axis:

The following list explains the buttons in the toolbar on the top. On iPhones and iPods, the full list of buttons is only visible in landscape mode.

Toolbar Buttons

from left to right:
  • Close
    This button saves your work and brings you back to the gallery.

  • Settings
    Here you can define whether the deformation is allowed to crop parts of the images and you can choose the size of the paint brush. The advanced settings give you access to the detailed parameters of the retargeting algorithm. For instance, you can show the underlying quad grid or enable regularization. Some of the exposed parameters are only for demo purposes to show the inner workings of the underlying algorithm. All of them are preset to values that are working well in most cases. So you should only change them if you want to explore the details of the retargeting algorithm.

  • Export
    A tap on this button renders a full resolution retargeted image in the current aspect ratio and saves it to the camera roll, so that you can insert it to emails, blogs, and so on.

  • Camera
    Take a new picture and edit it directly. All your work on the current picture will be saved first.

  • Photo Library
    Choose a picture from your photo library and directly edit it. All your work on the current picture will be saved.

  • Show / Hide Saliency Map
    Here you can switch between seeing the following to views:

    • Show Saliency
      Displays the saliency map on top of the image. You can also see the cropped parts when using the combined view.

    • Hide Saliency
      See the optimized retargeted image in all its beauty.

  • Combined / Split View
    Here you can switch between seeing the following two views:

    • Combined View
      Displays the retargeted image using the whole screen. You can directly paint onto the retargeted image. When showing the saliency, you can also visualize the cropped image parts and paint onto them.

    • Split View
      You can see the image in original and retargeted aspect ratios side by side. To paint saliency, move your finger across the original image.

  • Aspect Ratio
    This palette allows you to choose out of a few predefined aspect ratios. Among them are the classical still picture and widescreen television ratios. You can also go back to the original aspect ratio. At the end of the list, all the ratios needed for the RetargetMe benchmark are provided.

  • Paint Brush / Eraser Tools
    To paint onto the saliency map, make sure that the paint brush is selected here. If you want to remove saliency, tap this button to change between the paint brush and the eraser.

  • Magic Wand
    By clicking the wand button, the app tries to automatically detect salient image parts. The app looks for strong edges and borders and detects faces in the image. You can improve the saliency map by just painting over it. By pressing the wand several times, you can increase the contrast in the saliency map.

  • Trash Bin
    You can reset the saliency map to start painting or detecting from scratch.


The following gestures are supported in the editor view:
  • Use a single finger to draw or erase on the saliency map.
  • Swipe up and down with two fingers to change the aspect ratio of the retargeted image.
  • Zoom in and out using a pinch gesture with two fingers. Once you are zoomed in, you can swipe with two fingers to move the picture around.
  • Tap with one finger to show / hide the saliency map and preview the cropping.
  • Tap with two fingers to zoom out and center the image.

Do you have any questions or problems?
Let me know if you like the app, found a bug or just want to say hi.