Skip to content

Seam carving: try the tool and understand the method

Resize an example photo and compare how seam carving changes it.

Original photo of a deer, 3:2
Original · 3:2
The same photo reshaped to 16:9 with the deer unchanged
YouTube · 16:9

Try content-aware resizing

Start with the example or upload a photo, pick a frame, then compare the result before you download.

Photo exports have no watermark.

Or drop a photo anywhere on this page. PNG, JPEG or WebP up to 25 MB.

How does seam carving work?

Start with the editable example or upload a photo, set a target size and process it. Compare the result to see where seam carving preserves detail and where it introduces distortion. The progress preview shows the changing image; this page does not display an energy map or draw each chosen seam.

Seam carving is a content-aware image resizing algorithm introduced by Shai Avidan and Ariel Shamir at SIGGRAPH 2007. See the original seam-carving paper. The key insight is that not all pixels in an image are equally important. By computing an energy map — typically the gradient magnitude at each pixel — the algorithm can distinguish between high-energy regions (edges, faces, text, sharp transitions) and low-energy regions (smooth gradients, sky, uniform backgrounds).

A seam is a connected path of pixels running from one edge of the image to the other (top to bottom for vertical seams, left to right for horizontal seams), where each pixel in the path is adjacent to or diagonally adjacent to the next. The algorithm uses dynamic programming to find the seam with the lowest total energy — the path that passes through the least visually important pixels in the image.

To shrink an image by one pixel in width, the algorithm removes the lowest-energy vertical seam. Repeating this process removes multiple seams, progressively narrowing the image while preserving high-energy content. To expand an image, the process is reversed: the lowest-energy seams are identified and then duplicated (the seam pixels are inserted alongside their neighbors), adding width in lower-energy regions. This describes the general technique; the tool above uses scaling, seam removal and, when needed, a preliminary crop to reach its target.

The energy function

The quality of seam carving depends heavily on the energy function used to evaluate pixel importance. The most common approach computes the gradient magnitude using the Sobel operator or a simple forward difference: for each pixel, measure how much its color differs from its neighbors. Large differences (edges) produce high energy; small differences (smooth areas) produce low energy. This implementation also supports face detection as an additional energy source — detected faces receive a high energy boost, making seams less likely to pass through them. Detection and protection can fail, so inspect faces in the result.

When does seam carving fail?

Seam carving works best when an image has clear regions of low and high importance. It struggles in specific scenarios:

  • Repeating patterns (brick walls, tiled floors, fabric textures) — seams can disrupt the regularity of the pattern, creating visible artifacts where tiles or bricks appear misaligned.
  • Faces near edges — if a face is at the very edge of the image and the resize requires significant expansion or removal in that direction, even face detection may not fully prevent distortion.
  • Extreme aspect ratio changes — large changes can exhaust low-energy regions and affect the subject. This tool limits carving to 25% of a dimension by pre-cropping when necessary; the quality note reports that crop. This implementation limit is not a guarantee of a clean result.
  • High-detail images with no clear background — dense scenes where every region has high energy (crowded streets, complex nature close-ups) leave the algorithm no good seams to remove.

For these edge cases, a combination of content-aware scaling with traditional cropping or manual masking typically produces better results. This tool defaults to PNG output format to preserve quality for cases where you want to inspect the result closely before final use.

Curious what happens when you push the algorithm past its limits on purpose? The content aware scale video generator animates the carving process frame by frame and exports it as an MP4 or GIF — the classic melting-image meme effect.