Seam carving

Seam carving also allows manually defining areas in which pixels may not be modified, and features the ability to remove whole objects from photographs.

[1] Image Retargeting was invented by Vidya Setlur, Saeko Takage, Ramesh Raskar, Michael Gleicher and Bruce Gooch in 2005.

It is also possible to invert step 4 so the algorithm enlarges in one dimension by copying a low energy seam and averaging its pixels with its neighbors.

[4] Adobe Systems acquired a non-exclusive license to seam carving technology from MERL,[6] and implemented it as a feature in Photoshop CS4, where it is called Content Aware Scaling.

[7] As the license is non-exclusive, other popular computer graphics applications (e. g. GIMP, digiKam, and ImageMagick) as well as some stand-alone programs (e. g. iResizer)[8] also have implementations of this technique, some of which are released as free and open source software.

[9][10][11] A 2010 review of eight image retargeting methods found that seam carving produced output that was ranked among the worst of the tested algorithms.

Original image to be made narrower
Scaling is undesirable because the castle is distorted.
Cropping is undesirable because part of the castle is removed.
Seam carving
Starting image
gradient magnitude energy
seams with energy
reduced energy image
final image
Interactive SVG demonstrating seam-carving using ImageMagick's liquid-rescale function. In the SVG file , hover over the percentages to compare the original image (top), its width rescaled to the percentage using seam-carving (middle), and rescaled to the same size using interpolation (bottom).
Interactive SVG demonstrating seam-carving using ImageMagick's liquid-rescale function. In the SVG file , hover over the percentages as above. Note that the faces are affected less than their surroundings.