Seam carving or Content-Aware Image Resizing (CAIR) is an algorithm developed by Shai Avidan and Ariel Shamir for image resizing that establishes the number of seams, connected paths of low energy pixels that are determined by magnitude of gradient, in an image and automatically removes seams to reduce image size or inserts seams to extend it.

Seam carving also allows manually defining areas in which pixels may not be modified and the ability to remove whole objects from photographs. The purpose of the algorithm is to display images without distortion on various media (cell phones, PDAs) using document standards, like HTML, that already support dynamic changes in page layout and text.

Dynamic programming is used in seam carving to remove unnoticeable pixels that blend in with their surroundings by mapping the total number of seams, figuring optimal vertical and horizontal seams and extending the optimal seams starting at every pixel of an image edge according to an "importance" function. A vertical seam is a path of eight single pixels connected from top to bottom in an image with one pixel in each row; horizontal seam is similar with the exception of the connection being from left to right. The importance function values a pixel by measuring its contrast with its neighbor pixels.

Author: Amit Tsur

Supervisor: Danny Varod

Source Code (requires Microsoft Visual Studio 2010)
Binaries (requires Microsoft .NET Framework 4)