Seam carving: content-aware image resizing

Technology

Ariel Shamir and Shai Avidan have presented the coolest digital image effect I have ever seen. “Seam carving” allows an image to be resized non-uniformly, so you can change the height to width ratio in the image without cropping, but also without distorting important features in the image (such as faces).

If I understood the demonstration correctly, the algorithm detects horizontal and vertical paths which span the whole image and have the least gradient magnitude along the span. When resizing an image, the pixels along these seams are stretched or removed, leaving the rest of the image untouched. Areas of an image that absolutely need to be preserved can be manually excluded, and the seam generating function will negotiate paths around those pixels.

You need to watch the video to really see this in action, but the technique can also be used to remove whole portions of an image without perceptible artifacts. Essentially, you could cut an Ex out of your old vacation photos and the rest of the image would distort itself, unnoticeably, to fill in the gap.

Seam Carving for Content-Aware Image Resizing – [via] Video: Link PDF: Link
High-res copy of the above video @ Dr. Ariel Shamir’s site – Link

18 thoughts on “Seam carving: content-aware image resizing

  1. Shakakai says:

    That’s really sweet. Its applicability to application development, the designer-developer work flow, and design in general is mind-boggling.

    If anyone successfully downloaded the PDF, could you post it somewhere. Looks like Dr. Shamir’s web server is getting pounded.

  2. thanig says:

    acm has a paper on it. July 2007. looks similar to the youtube presentation.

    http://portal.acm.org/citation.cfm?id=1276377.1276390&coll=portal&dl=ACM&CFID=15151515&CFTOKEN=6184618

  3. jimmy.kl says:

    Agreed it’s a neat effect and effortlessly accomplishedWhat I think is scary about it isn’t the ease of removing people or the likes – that’s easily accomplished (though not so fluidly) with photoshop et al. – it’s the distortion of any concept of composition which the original image had. See Nat Geo pyramids fiascoCreators of imagery spend their lives working with compositions and mastering their techniquess and now we’re going to squash and munge their images just to fit the ‘important parts’ on an iPhone?? Pssssssesh.

  4. yoyolele says:

    A really cool explanation with illustrations is available here:
    http://yaniv.leviathanonline.com/blog/math/seam-carving/

  5. yoyolele says:

    A very good article explaining the algorithm (with many photos) is available at http://yaniv.leviathanonline.com/blog/math/seam-carving/.

  6. sgill says:

    a browser applet of the algorithm here.

  7. untitled1 says:

    For those interested, I have implemented a parts of the algorithm from the paper in C++. You can download the software (currently windows only) from my site.

  8. rsizr says:

    Check out rsizr.com for a Flash-based implementation of seam carving that lets you resize images, both in height and width simultaneously, in real time.

  9. Dan Luong says:

    Hi, I’ve implemented the seam carving algorithm in MATLAB with GUI and complete documentation and tutorial so that others new to seam carving can more easily understand the operations invloved. My source code and documentation can be found here:
    http://danluong.com/2007/12/21/seam-carving-matlab-implementation-tutorial/

Comments are closed.

Discuss this article with the rest of the community on our Discord server!
Tagged

ADVERTISEMENT

Maker Faire Bay Area 2023 - Mare Island, CA

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 15th iteration!

Buy Tickets today! SAVE 15% and lock-in your preferred date(s).

FEEDBACK